Ticket #7 (assigned defect)

Opened 5 years ago

Last modified 5 years ago

Network.Socket.recv throws IOException on reading 0 bytes

Reported by: tibbe Owned by: tibbe
Priority: major Milestone:
Component: network Version:
Keywords: Cc:

Description

Initially reported here: http://hackage.haskell.org/trac/ghc/ticket/3071


My man pages has the following to say about the return value of recv:

These calls return the number of bytes received, or -1 if an error occurred.

For TCP sockets, the return value 0 means the peer has closed its half side of the connection.

This means that it's absolutely fine to read 0 bytes when using e.g. UDP socket.

However, the Network.Socket.recv function always throws an exception upon reading 0 bytes regardless of the protocol family.

Change History

Changed 5 years ago by anonymous

  • owner set to anonymous
  • status changed from new to assigned

Changed 5 years ago by tibbe

  • owner changed from anonymous to tibbe
  • status changed from assigned to new

Changed 5 years ago by tibbe

  • status changed from new to assigned
  • milestone set to 2.2.1.3
Note: See TracTickets for help on using tickets.