Re: Problem with recv syscall on socket when other side closed

Igmar Palsenberg (maillist@chello.nl)
Sun, 25 Jun 2000 04:18:10 +0200 (CEST)


On Sat, 24 Jun 2000, Denis Perchine wrote:

> Hello all,
>
> There's quite strange behavior of the linux kernel when other side closed connection
> and we try to read from socket.

1) You get a SIGPIPE, and if you don't catch it, you'll get shot

2) You used the MSG_NOSIGNAL and recv returns -1 (error) and errno
contains EPIPE. It's in the manual.

> Firstly I get -1 and EPIPE in errno. Hmmm... I could not find anywhere in standards or manpages
> that recv can return EPIPE. OK...

man recv in my case states the EPIPE case..

> The if I try to continue read I will get the rest of the data which arrived between last read and
> connection close... Very strange logic... Any comments on this.

Indeed strange..


Igmar

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/