4

I want a way to detect that the client has closed the socket so I can deregister it, but I can not find any suitable way to do it.

My question is similar to Detecting client hangup in MIO, but there are two main differences:

  1. I need a cross-platform solution. According to the source code of mio 0.6, hup is a UNIX-only thing, my code should also work on Windows.

  2. The API of mio dramatically changed since 0.3.

Community
  • 1
  • 1
user1244932
  • 7,352
  • 5
  • 46
  • 103
  • If the client closed the socket, i.e. closed the connection normally, you will get a normal end of stream indication when reading, or a 'broken pipe' or 'connection reset' when writing. – user207421 Mar 21 '17 at 09:07

0 Answers0