Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Aug 2006 11:20:16 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        Brett Glass <brett@lariat.net>
Cc:        questions@freebsd.org
Subject:   Re: Increasing socket send buffer size
Message-ID:  <A9A19639-A3CD-4DA4-B15E-C1E46406F26D@mac.com>
In-Reply-To: <7.0.1.0.2.20060821212315.09b9aeb0@lariat.net>
References:  <7.0.1.0.2.20060821212315.09b9aeb0@lariat.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 21, 2006, at 8:50 PM, Brett Glass wrote:
> I'm working with a system in which a program is failing because it  
> sometimes tries to write more data to a stream socket than will  
> fit. It reports that it can't write to the socket because it's out  
> of buffer space, then dies ungracefully.
>
> What's the best solution to this problem?

Have the code wait a few milliseconds to tens of milliseconds and  
retry the write()?  Or switch to non-blocking mode and pay attention  
to the return value from write, and retry as needed if and when write 
() doesn't actually send out all of the bytes your request wanted it  
to...

-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A9A19639-A3CD-4DA4-B15E-C1E46406F26D>