Link to home
Start Free TrialLog in
Avatar of olegsp
olegsp

asked on

Exchanging data between Java applet and server

I have a client Java applet, which needs to exchange data with its server (implemented in C++). Initially, we used sockets for that purpose, but with the spread of various firewalls this mechanism has become virtually impossible – it’s hard to ask all your web users to open a particular port to make the applet work. Is there a more reliable method for applet-to-server data exchange?

My data consists mainly of text strings and large image binary buffers.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Can you use a serv;et instead? Or maybe CGI script?
If you can run a servlet on the server, then Applet-> servlet communication isn't too hard (and it will go over port 80)
You could use port 80 (and http tunnelling if required) to get thru most firewalls.
Whatever method you use is more than likely going to need a port.
hehe :-)
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

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
http://jdj.sys-con.com/read/36044.htm

shows the use of an ObjectOutputStream to serialize java objects between an applet and a servlet...
Avatar of olegsp
olegsp

ASKER

Thanks for the feedback. Mainly, you suggest Java servlets (and I am really new to them), but my server is written in C++ (Visual C++), so I need some C++ solution on the server side. Any ideas?

Another related question. Let's say, on my server computer, I am running my C++ server, and Apache (as a web server) - this is my classical environment. Apache works at port 80, which is usually open in any firewall. Can I make my C++ server work at the same port, talking to my applet?
SOLUTION
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
You can write CGI scripts in C++, and you should be able to read the data sent to it on the stdin stream...

This is outside my realm of knowledge though...all I could give you are google links... :-(

Tim
> so I need some C++ solution on the server side. Any ideas?

Same principles, you need something listening on port 80 that passes the request on to your C++ server.
>> so I need some C++ solution on the server side. Any ideas?
SOAP?

>> Same principles, you need something listening on port 80 that passes the request on to your C++ server.
Adding to that: when passing data thru port 80 many firewalls will reject non HTML based content (which makes
soap an even more attractive option).