G
gobo
Hallo,
I have an C++/MFC-Program that creats a socket server via a class
derived from CSocket. In its ::OnReceive()-Method it does its job.
In a Java-Class, this socket is opened (new Socket()) and its Input-
and OutputStream used for communication.
That works so far. However: sometimes(!) the communication is broken.
The Request from the java-Part is not received in the OnReceive()-
Method in the MFC-Server. So, everything hangs, the Java-part is
waiting infinitely for an answer that is not computet, because the
Server did not receive the request.
debug-output has shown, that the previous OnReceive()-method in the C+
+/MFC-part did run to an end - seemingly without any error. But after
that, it does not receive anymore. The writing of data into the
OutputStream also did not result in an Exception.
I thought, one process overtook the other, so i put in a sleep in the
java-part after receiving any answer - but it did not work.
Curiosly enough - the problem does not occur on every PC, but there
are PCs where the error occurs more often that on others. Also we had
a nearly a whole day where the error did not occur at all!
It also does not occur alway at the same call. It is seamingly random
- but I dont think so. There must be a reason.
We are complete at a loss. Is there any important status, that we
could read before sending the request in java? Is there any way to
check if the MFC-Socket is still open and listening? Is there a way to
restart the socket?
Thanx for any help - we really could do with a hint
Goetz
I have an C++/MFC-Program that creats a socket server via a class
derived from CSocket. In its ::OnReceive()-Method it does its job.
In a Java-Class, this socket is opened (new Socket()) and its Input-
and OutputStream used for communication.
That works so far. However: sometimes(!) the communication is broken.
The Request from the java-Part is not received in the OnReceive()-
Method in the MFC-Server. So, everything hangs, the Java-part is
waiting infinitely for an answer that is not computet, because the
Server did not receive the request.
debug-output has shown, that the previous OnReceive()-method in the C+
+/MFC-part did run to an end - seemingly without any error. But after
that, it does not receive anymore. The writing of data into the
OutputStream also did not result in an Exception.
I thought, one process overtook the other, so i put in a sleep in the
java-part after receiving any answer - but it did not work.
Curiosly enough - the problem does not occur on every PC, but there
are PCs where the error occurs more often that on others. Also we had
a nearly a whole day where the error did not occur at all!
It also does not occur alway at the same call. It is seamingly random
- but I dont think so. There must be a reason.
We are complete at a loss. Is there any important status, that we
could read before sending the request in java? Is there any way to
check if the MFC-Socket is still open and listening? Is there a way to
restart the socket?
Thanx for any help - we really could do with a hint
Goetz