The Artima Developer Community
Sponsored Link

Java Answers Forum
Java C++ Socket Communication

3 replies on 1 page. Most recent reply: Sep 4, 2002 1:35 PM by Thomas SMETS

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Ramesh

Posts: 2
Nickname: minushan
Registered: Aug, 2002

Java C++ Socket Communication Posted: Sep 3, 2002 8:40 AM
Reply to this message Reply
Advertisement
Hi there,
we have a java method on a machine say(xxx.xxx.xxx.xxx) which has a method that accepts 2 integers and return the sum .On the other side we have C++ class method on another machine say yyy.yyy.yyy.yyy which needs to call my java method by passing the arguments and use return result.The main constraint here is i want to do this by using Sockets.Can anyone help me how to do this??I am very new to Sockets on either side.
Code segments will be greatly helpful.
Thanx
ramesh.s


Prasanna

Posts: 11
Nickname: pras
Registered: May, 2002

Re: Java C++ Socket Communication Posted: Sep 3, 2002 9:27 PM
Reply to this message Reply
It's not possible to invoke a method of a program residing on another machine via sockets.The alternatives are:
1)RMI:if the two programs are in Java
2)CORBA if one program is in Java and the other is in C/C++.
HTH.

Javed

Posts: 15
Nickname: javedm
Registered: Aug, 2002

Re: Java C++ Socket Communication Posted: Sep 4, 2002 12:29 AM
Reply to this message Reply
While RMI and CORBA are very good for distributed computing, we cannot rule out the possibility of sockets altogether.

It is very much possible (we are doing an application where a Flash client talks to a Java server over sockets, so I am assuming that it should be possible in C++ as well) for a C++ client to talk to a java server over sockets, but it cannot invoke a method directly. C++ can pass a request, say in XML format. Server should be able to parse the XML request, process the request and send the response back to the client in XML format.

I hope I am clear in answering your question.

Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: Java C++ Socket Communication Posted: Sep 4, 2002 1:35 PM
Reply to this message Reply
OKay guy's you pointed out RMI & CORBA.
May be looking in the directionof SOAP is also a good idea ?

Thomas SMETS,
SJCP2 - Brussels

Flat View: This topic has 3 replies on 1 page
Topic: String Array convert to TreePath Previous Topic   Next Topic Topic: Help me Please  as early as possible.....

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use