From: Chris Snook <csnook@redhat.com>
To: Hua Zhong <hzhong@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: tcp write returns 0?
Date: Thu, 21 Aug 2008 16:31:14 -0400 [thread overview]
Message-ID: <48ADD092.7080203@redhat.com> (raw)
In-Reply-To: <007901c903c1$044b8780$0ce29680$@com>
Hua Zhong wrote:
> Under what condition would tcp write return 0?
>
> Especially since a previous poll() indicates the socket is writable. Could
> this only happen for socket in NONBLOCK mode?
The socket could become unwritable for various reasons between poll()
returning and the send() call. This shouldn't happen very often, but if
the system is under memory pressure and needs to page in data between
those two calls, that race window can get rather large. You might want
to increase your TCP buffer sizes, either per-socket with setsockopt, or
system-wide with sysctl.
-- Chris
prev parent reply other threads:[~2008-08-21 20:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-21 19:06 tcp write returns 0? Hua Zhong
2008-08-21 20:31 ` Chris Snook [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48ADD092.7080203@redhat.com \
--to=csnook@redhat.com \
--cc=hzhong@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).