Problem when connecting Java App with C++ App using Windows Socket

Problem when connecting Java App with C++ App using Windows Socket

Post by S2V2aW4gTF » Thu, 28 May 2009 19:16:00


I encounter such a strange problem:
We have a VC++ Application, which needs to communicate with another Java
application using socket (in VC++ we use Windows socket indeed). The Java App
acts as the server and VC++ App as the client. The two works well when
implement them in the same computer. However, if they are implemented in
different computers, whether in a LAN or in a WAN (acrossing routers),
problem encounters: the Java App often reported it detects socket error and
close the socket (and the connection) which the VC++ client makes, then the
VC++ client will try to reconnect the Java App again, thus result in such a
situation, the connection is made, then about 20-30 seconds later, the
connection is closed, then reconnect,...
We found that often the Java App detected socket error when it tried to
write data to the client. if there was no data to write to client, Java won't
detect the socket error. Of course, the link between the two app is OK.
We don't know why, the Java App is developed by another company, and we
don't have much experience in Java so we couldn't give much advice to them.
However, in our point, we think socket programming model is universal
acrossing different platforms and different programming languages. Maybe we
are wrong? If we want to communicate Java App using Windows socket, we need
to do something special ?

Thanks

Kevin Liu
 
 
 

Problem when connecting Java App with C++ App using Windows Socket

Post by Neil Smith » Thu, 28 May 2009 20:19:03

On Wed, 27 May 2009 03:16:00 -0700, Kevin LZJ



That's a pretty special application and sounds fascinating, but it's
not appropriate for this newsgroup (about windows media, hence the
title of microsoft.public.windowsmedia ;-)

Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2009
http://www.yqcomputer.com/