Leon Finker wrote: > > Is there a reason that result of -1 is used instead of somewhat > universal 0 for detecting graceful shutdown on recv side for sockets? > Thanks! > EOF can't be indicated by 0 as otherwise you couldn't distinguish it from cases where zero bytes are read (say a SocketChannel configured in non-blocking mode). -Alan.