File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes what does  this Exception mean???thanx!@!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "what does  this Exception mean???thanx!@!!!" Watch "what does  this Exception mean???thanx!@!!!" New topic
Author

what does this Exception mean???thanx!@!!!

Javan Li
Ranch Hand

Joined: Jul 24, 2002
Posts: 84
java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
From The java.net.SocketException Class Documentation:
Thrown to indicate that there is an error in the underlying protocol, such as a TCP error.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
Often it means that the "other end" of the socket closed its stream. For example, if you see this on a web server, it might mean that a user killed their browswer while in the middle of loading a page. The browser went away, so the server saw the connection being reset (killed) by the peer (the other guy - browser).
Can mean other things, but this is the most common I've seen.
Javan Li
Ranch Hand

Joined: Jul 24, 2002
Posts: 84
Does it do harm to my C/S program? Whether i should do something??
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
It depends on the circumstance.
If you have written the code on both sides of the socket and you think you are reading the streams fully and closing them only when you are done, this exception might mean you are loosing data.
For this, you need to make sure you read the streams fully (to the end) and don't close EITHER input or output stream from a socket until you are finished with both of them (closing either will close the socket).
If you have written a server and the clients are not in your control (for example a browser in somebody's bedroom), then it might mean that the client disconnected.
Javan Li
Ranch Hand

Joined: Jul 24, 2002
Posts: 84
Thanx a lot, u are great help!
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
Sockets are not for "beginners". I'm moving this to Java in General (intermediate)


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what does this Exception mean???thanx!@!!!