分类:
2007-11-14 18:39:39
peer is a tough one because it can be caused so many things. In all cases, the server determines that the socket is no longer good and closes it from its side.
Read Error
Scenario: Mary couldn't make out what Joe was
saying anymore, so she hung up rather than lose his messages (data).
A read
error occurs when a server cannot successfully read from a user's client.
Servers gather information from the client
text, setup, and other items.When the server receives an error when reading from
a client, it then disconnects the user, resulting in a read error quit
message.
Write Error
Scenario: Mary was trying to talk to Joe but
didn't think she was getting through, so she hung rather than lose his messages
(data).
A write error occurs when a server cannot successfully write to a
user's client. When the server receives information, it usually responds with
information of its own. When the server receives an error when writing to a
client, it then disconnects the user, resulting in a write error quit message
similar to the read error format.
Ping Timeout Error
Scenario: Mary, having been raised in
a household with too many kids and always craving attention, keeps asking to
make sure that Joe is still on the line and listening. If he doesn't reply fast
enough to suit her, she hangs up.
Servers automatically ping users at a p
time. The reason for this is to ensure the client is still connected to the
server. When you see "PING? PONG!" results in your status window, it means the
server has pinged your client, and it has responded back with a pong to ensure
the server that you are still connected. When this does not happen and you
disconnect without the server's knowledge, the server will automatically
disconnect the user when it does not receive a response, resulting in a ping
timeout. Ping timeouts occur to EVERYONE.
Broken pipe Error
Scenario: Mary had picked up a sticky
note with a message she needed to relay to Joe, but somehow between her hand and
her mouth, the message got misplaced. Mary was trying to talk to Joe but didn't
think she was getting through, so she hung up rather than lose his messages
(data).
A broken pipe error occurs when the server knows it has a message
but can't seem to use its internal data link to get the data out to the
socket.
Miscellaneous
Scenario: Lots of other reasons; perhaps
the operator broke in and gave Mary a message that made her doubt the validity
of the call so she hung up.