Opened 14 years ago

Closed 14 years ago

#277 closed defect (fixed)

Socket client cannot tell the other side closed the connection

Reported by: Jiri Svoboda Owned by:
Priority: major Milestone: 0.4.3
Component: helenos/net/socket Version:
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

On a TCP socket the close() operation is unidirectional. When side A sends some data and closes the connection, side B will receive all data send by A and then it will see that no more data will follow (recv() will return 0 bytes).

The socket client code is not informed that no more data will follow. Thus if side A closes its side of the connection, recv() on side B blocks indefinitely.

Change History (2)

comment:1 by Jiri Svoboda, 14 years ago

Fixed in changeset:mainline,773. End of data is now signaled by the socket provider by a NET_SOCKET_RECEIVED message with 0 data fragments. This is propagated into the receive FIFO and recvfrom_core() returns 0 if it encounters the zero fragment count. At the same time I fixed handling of incoming FINs in TCP.

comment:2 by Jiri Svoboda, 14 years ago

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