Re: sendfile() not detecting closed connections.

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Fri, 2 Nov 2007 16:26:45 +0100 (BST)
On Fri, 2 Nov 2007, Ian FREISLICH wrote:

> sendfile() reports success for files less than about 64k in size, but I 
> haven't been able to figure out where the threshold is.  It erroneously 
> reports that 41000 of the 64k were sent, but will say the whole file was 
> transferred up to about 64k.  The connection filedescriptor is blocking.

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.

Robert N M Watson
Computer Laboratory
University of Cambridge
Received on Fri Nov 02 2007 - 19:14:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:20 UTC