Opened 11 years ago

Closed 11 years ago

#3071 closed bug (invalid)

Network.Socket.recv throws IOException on reading 0 bytes

Reported by: tibbe Owned by:
Priority: normal Milestone:
Component: libraries/network Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

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 (1)

comment:1 Changed 11 years ago by tibbe

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.