Testing for a closed socket

后端 未结 3 1180
北荒
北荒 2021-01-04 19:45

I\'m trying to test for a closed socket that has been gracefully closed by the peer without incurring the latency hit of a double send to induce a SIGPIPE.

3条回答
  •  感动是毒
    2021-01-04 19:54

    Do you control the other end? The most reliable way to perform a "clean" shut down of a socket is for the other end to send a "goodbye" message of some sort.

提交回复
热议问题