Hey everyone,
I am really rusty on my Java socket programming and am having some confusing problems. I don't need the code debugged(even though it doesn't work). I'm not going to make you dig through all the abstraction layers and such.
Anyways here is my issue. The application sends a request for data to the server and the server responds. However, the server then sends a TCP Fin message to close the connection which I can see through wire shark.
How do I tell when the connection is closed and how do I open it again? Also, what do isClosed, isBound and isCOnnected do in the Java socket class.
My program is crashing because I am trying to write to a closed socket(I think).
However, I get the following weird scenario:
isConnected True
isBound True
isClosed False
This would seem to indicate the socket is still open, but when I write to the socket I get the following Exception:
java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
Can anyone explain what is going on?
Thanks,
Jon