lkml.org 
[lkml]   [2007]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: sendfile to nonblocking socket
Date

> As I see, nonblocking mode is enabled - sendfile sends less than asked.
> But 2G via single 30 seconds sendfile call - this is blocking call. How
> can I avoid that? I prefer sendfile as fastest way to send file
> content to network socket. The problem with sendfile block on
> nonblocking socket has place only when I'm using network connection,
> that is faster than my hard disk, for example gigabit NIC or localhost.
> When I use 100Mbit NIC, which is slower, than my hard disk, I got small
> and fast sendfile calls without blocking.
>
> My kernel is Linux 2.6.20.3-grsec x86_64. I verified that also on
> 2.6.18 - same results. Please advise.

You have a misunderstanding about the semantics of 'sendfile'. The 'sendfile' function is just a more efficient version of a read followed by a write. If you did a read followed by a write, it would block as well (in the read).

DS


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-24 00:55    [W:0.209 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site