I'm using JDK 1.3 (BD-J platform) using tcp sockets.
I seem to be getting some errors half closing on the client end. If I'm done writing and close the lower socket output stream, I seem to get an exception trying to read from the server end (most messages go through if it's not closed), but when it's closed I run into troubles.
Attempting to debug with the server, shouldn't I be able to read everything the client sends even if the socket is closed? Just using the low socket Input stream on the server side. If I run it normally I get most message, attempt to run the server in the debugger I get 1 message then a Socket Exception Connection Reset.
Here is partial code on the client end of how it sends messages then closes when it's done writing, waits for all input to finish then closes the socket entirely.
http://pastie.org/private/cwc5uijl1x2ndwjwsun4lg
Really frustrated that I can't find the problem
You need Socket.shutdownOutput
. Closing either the InputStream
or the OutputStream
of a Socket
closes the Socket
(crazy, but true).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With