Deutsch
Germany.ruФорумы → Архив Досок→ Программирование

Socket: Как удостовериться что связь в норме?

16.03.17 22:46
Re: Socket: Как удостовериться что связь в норме?
 
  moose свой человек
в ответ anly 16.03.17 20:47, Последний раз изменено 16.03.17 22:48 (moose)
Как удостовериться что связь в норме? (без Send).

Читаем букварь:


Key Concept: A TCP connection is normally terminating using a special procedure where each side independently closes its end of the link. It normally begins with one of the application processes signalling to its TCP layer that the session is no longer needed. That device sends a FIN message to tell the other device that it wants to end the connection, which is acknowledged. When the responding device is ready, it too sends a FIN that is acknowledged; after waiting a period of time for the ACK to be received, the session is closed.


Если вышеописанная процедура не могла успешно завершиться (отсутствие физического соединения, например), то сервер попрежнему считает, что у него установлено соединение с клиентом. Клиент же уверен, что соединение закрыто. Рядовая ситуация. Воспроизводится для теста элементарно: из машины клиента или сервера выдергивается кабель и клиент "закрывает соединение".

 

Перейти на