netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tcp write returns 0?
@ 2008-08-21 19:06 Hua Zhong
  2008-08-21 20:31 ` Chris Snook
  0 siblings, 1 reply; 2+ messages in thread
From: Hua Zhong @ 2008-08-21 19:06 UTC (permalink / raw)
  To: netdev

Hi,

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?

Thanks.

Hua


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tcp write returns 0?
  2008-08-21 19:06 tcp write returns 0? Hua Zhong
@ 2008-08-21 20:31 ` Chris Snook
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Snook @ 2008-08-21 20:31 UTC (permalink / raw)
  To: Hua Zhong; +Cc: netdev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-21 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-21 19:06 tcp write returns 0? Hua Zhong
2008-08-21 20:31 ` Chris Snook

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).