On Tue, Sep 3, 2013 at 6:56 PM, Simon Yarde <simonyarde@me.com> wrote:
I'm new to Haskell and have reached an impasse in understanding the behaviour of sockets.
The crux of my line of enquiry is this; how can my application know when to pause in generating its chunked output if send doesn't block and the current non-blocking send behaviour apparently succeeds when the send buffer should be full?
'send' will eventually block after enough 'send's without matching 'recv's. As Brandon explains, there is more buffering going on than the send buffer. In particular, the receiving host will accept segments until its buffer fills up. TCP implements flow control (i.e. keeps the sender from flooding the receiver) by