Link to home
Start Free TrialLog in
Avatar of UTEK
UTEK

asked on

Java : "C/C++ Can you hear me?"

If I have a java applet running on the client machine and it communicates with the Java Servlet on the server, is there any universal solution(fit for all popular servers) that the servlet can pass variables and information it gets from the request headers to a C/C++ program running on the server?

I have checkout some other java books, but none of them talks about the communication between Java code and C/C++ code.

Thank you.
Avatar of slok
slok

how about using Tcl to 'glue' your servlet and C/C++ program ?
Yes you can pass the data through sockets.
That is provided you have the c/c++ programs setup as servers that will listen on a server socket for data to arrive from the servlet.The servlet can then pass this data to the c/c++ programs through the socket that is opens on the program.

Avatar of UTEK

ASKER

I would be appreciated if you can give me some more details/resource links on the suggestions.


For rainmal:
Is that mean a C/C++ can pass back the data to the servlet using open the socket?
How about CORBA?  CORBA allows you to call methods in C++ from Java.  Check out the Visigenics CORBA solution:

http://www.borland.com/visibroker/
ASKER CERTIFIED SOLUTION
Avatar of rainmal
rainmal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
maybe you could look up the chat servlet that uses sockets to transfer data between an applet and the servlet as well.

http://www.servlets.com/jsp/examples/ch10/index.html
If you are looking for a long term solution, you probably want to seriously consider CORBA. When it comes to multi-tiered applications that involves legacy code in different languages, CORBA is the most comprehensive solution yet, imho.

One big plus is that only the CORBA wrapper developers need to learn CORBA, and the rest of the programmers on the two ends would only worry about what they already know.

If you plan to use EJB and application servers, a CORBA development environment is often provided already.