1
read, write, err = select.select([sock1, sock2], [], [])

If either sock1 or sock2 are closed from the other end and they begin receiving the EOF ("") then will select return them as readable or does it ignore that and continue blocking?

Milan Novaković
  • 331
  • 8
  • 16

1 Answers1

4

The socket is marked readable on EOF so select will return the socket and sock.read() will return zero bytes.

tdelaney
  • 73,364
  • 6
  • 83
  • 116
  • see also http://stackoverflow.com/questions/14594508/fifo-pipe-is-always-readable-in-select which discusses underlying C API. – Elliott Beach May 09 '17 at 02:36