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.
UTEKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slokCommented:
how about using Tcl to 'glue' your servlet and C/C++ program ?
0
rainmalCommented:
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.

0
UTEKAuthor Commented:
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?
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

jjdunneCommented:
How about CORBA?  CORBA allows you to call methods in C++ from Java.  Check out the Visigenics CORBA solution:

http://www.borland.com/visibroker/
0
rainmalCommented:
Yeah you can pass back data to the servlet.
One of the ways you could do this is just invoke the servlet through the socket and pass the data as a name value pairs

or you could spawn a thread through the servlet that will listen to requests from the c++ program on a socket

Jason hunter shows how this is done in his daytime servlet example.
you can find this at
http://www.servlets.com/jsp/examples/ch10/DaytimeServlet.java
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rainmalCommented:
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
0
memingCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.