L
L
LiptonOlolo2016-03-03 23:49:20
C++ / C#
LiptonOlolo, 2016-03-03 23:49:20

Why is the socket server crashing?

Good night, just like that, the socket server crashes with the error "Connection reset by peer
"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vladimirchelyabinskiy, 2016-04-08
@vladimirchelyabinskiy

Connection reset by peer
Connection reset by peer can be caused by completely different reasons. In general, the server determines that the socket is no longer working properly and closes it on its side.
5.1 Read Error
Scenario: Mary can't understand what Joe is saying and hangs up instead of losing his messages (data).
A read error occurs when the server cannot successfully read data from the client. The servers collect information from the client and when they get an error while reading the data, they disconnect the user, which results in a "Read Error" message on exit.
5.2 Write Error
Scenario: Mary tries to talk to Joe but thinks he can't hear her. So she hangs up instead of putting up with the loss of messages (data).
A write error occurs when the server cannot successfully write information to the client. When the server receives information, it usually responds with its own data to the client. If the server gets an error while writing to the client, it disconnects the user, and this results in a "Write Error" message in a format similar to "Read Error"
5.3 Ping Timeout
Scenario: Mary, running around with the kids and being greatly distracted, continually asks Jo if he is listening to her. And if he doesn't get an answer fast enough, he hangs up.
The server automatically pings the user after a certain period of time. This is done in order to make sure that the client is still connected. When you see the messages "PING? PONG!" in the status window, it means that the server sent a ping request to your machine and it sent back a pong response. If you disconnect and the server does not know about it, it will automatically reset your nickname from the network after a long time without receiving pong answers, which will result in a "ping timeout" ticket. This can happen to anyone.
5.4 Broken pipe
Scenario: Mary found a note with a message to give to Joe, but somehow, the message got lost between the note and her mouth. Mary tries to give Joe the contents, but is not sure if she gets it and hangs up, believing this is a better option than losing information (data).
A "broken pipe" error occurs when the server realizes that it has a message to send out, but it can't submit it to the socket due to an internal data transfer error.
5.5 Other errors
Scenario: Lots of options; perhaps the operator intervened in the conversation and this made Mary doubt the correctness of the call and she hung up.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question