Increasing socket send buffer size

Chuck Swiger cswiger at
Tue Aug 22 18:20:52 UTC 2006

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  


More information about the freebsd-questions mailing list