Re: flushing a socket on linux

Steven Suson (suson@tti.TuckerEnergy.com)
Thu, 11 Jun 1998 14:35:43 +0000


owner-linux-kernel-digest@vger.rutgers.edu wrote: ------------------------------

> From: Jerry Geis <geisj@pagestation.com>
> Date: Thu, 04 Jun 1998 21:43:13 -0500
> Subject: flushing a socket on linux
>
> I am trying to find out how to flush a socket
> under linux.
>
> I tried ioctl(fd, TCFLSH, 0) but I think that only
> works for terminal file descriptors not sockets.
>
> What I am trying to do is detect a socketpair()
> connection has been lost before I use sendmsg
> to send a file descriptor to the other task.
>
> I do realize that catching SIGPIPE after sendmsg is
> called should work, I need to know if the connection
> is lost before that.
>
> Please CC me directly.
>
> Thanks,
>
> Jerry Geis
>

I believe that you can use select to know immediately when a socket has been closed.

Steve Suson
"Keep the faith."

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu