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

From: Igmar Palsenberg (maillist@chello.nl)
Date: Mon Jun 26 2000 - 08:12:09 EST


On Sun, 25 Jun 2000, Denis Perchine wrote:

> > > 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.
>
> In which manual? I do not have it in my man page. Also there's nothing about this
> in POSIX.

man recv in my 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..
>
> That's why some people do not like linux... Such behavior breaks lots of programs.

Assuming it is indeed the kernel that makes the error, and not your
program that screws things up.

        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/



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:08 EST