sendfile() not detecting closed connections.

David Schwartz davids at
Fri Nov 2 14:08:46 PDT 2007

> Probably what is happening is that sendfile() is counting bytes
> successfully
> inserted into the send socket buffer, rather than bytes sent on the wire.
> This is consistent with what happens when you write a file to a
> TCP socket,
> though, as you only know the bytes made it into the buffer, not
> to the remote
> destination.  I'd guess the threshold size you're seeing above is
> the size of
> the default send socket buffer.

Don't think so. After all, the connection was known to be closed (on both
ends) before he called 'sendfile'. So how could any bytes have successfully
been put into the send buffer?


More information about the freebsd-current mailing list