Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Socket closing unexpectedly?

843790Mar 4 2009 — edited Mar 6 2009
I'm really new to networking with sockets, so I don't really know where to even start debugging this...

I'm creating a pretty simple client/server pair which communicate with serialized objects. So far the server seems to run fine. My problem is when running my client it creates the socket and output stream to the socket fine, but when I try write to it I get "SocketException: Socket closed". I'm confused why creation works fine but writing does not. Also, if I uncomment my code to create the input stream from the socket that will hang and will never complete. One possibility: I'm trying to run both client and server on my desktop for testing - would this create these symptoms? If not, any suggestions on how I can fix this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2009
Added on Mar 4 2009
12 comments
1,769 views