?
Solved

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

Posted on 2000-02-04
7
Medium Priority
?
181 Views
Last Modified: 2013-11-24
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.
0
Comment
Question by:UTEK
7 Comments
 
LVL 3

Expert Comment

by:slok
ID: 2490227
how about using Tcl to 'glue' your servlet and C/C++ program ?
0
 
LVL 1

Expert Comment

by:rainmal
ID: 2490229
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
 

Author Comment

by:UTEK
ID: 2490441
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 1

Expert Comment

by:jjdunne
ID: 2490666
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
 
LVL 1

Accepted Solution

by:
rainmal earned 300 total points
ID: 2490782
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
 
LVL 1

Expert Comment

by:rainmal
ID: 2490980
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
 
LVL 2

Expert Comment

by:meming
ID: 2502402
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
A solution for Fortify Path Manipulation.
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month5 days, 12 hours left to enroll

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question