[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem with GNU C



From: "Martijn van Oosterhout" <kleptog@svana.org>
> > The real reason of termination: program receives SIGPIPE on send().
Select()
> > says that socket is writeable alredy. Removing fcntl will resolve
problem.
> > Any ideas?

> Oh, that's easy then. The socket is marked writable because the other end
> has closed. You receive a SIGPIPE because you're writing to a closed
socket.
> Are you checking the return codes from write?

Hmm, are you believe, that "other end" (peer?) closes socket when code
running on the one box, and not closes when it's running on another box, at
the same network? And why peer terminates connection only when socket is
nonblocking? It more likelly that select() marks socket as writeable before
it is actually writeable, or the system closes nonblocking socket for
another reason.




Reply to: