[Haskell-cafe] test socket buffer full

Alberto G. Corona agocorona at gmail.com
Thu Sep 17 14:01:53 UTC 2015

It seems that hPutBuffNonBlocking flush the buffer and blocks anyway when
it has not enough space for the next message.

    -- else, we have to flush        else do debugIO
"hPutBuf: flushing first"                old_buf'
<- Buffered.flushWriteBuffer
haDevice <https://hackage.haskell.org/package/base->
old_buf <https://hackage.haskell.org/package/base->
                       -- TODO: we should do a non-blocking flush here


this should be a bug or a feature not implemented.

since the flush uses flushWriteBuffer
that blocks,  hPutBuffNonBlocking does the same than hPutBuff and the
buffer congestion can not be detected.

I will try to do a new version with flushWriteBuffer0
do not blocks.

2015-09-17 15:41 GMT+02:00 james <james at mansionfamily.plus.com>:

> On 17/09/2015 13:52, Brandon Allbery wrote:
>> ...
>> It is possible that recent network package changed this, but in the past
>> *all* socket operations had to be under the aegis of *one* withSocketsDo,
>> otherwise any handles, buffers, etc. would become invalid when Winsock was
>> deinitialized.
> See
> http://neilmitchell.blogspot.co.uk/2015/02/making-withsocketsdo-unnecessary.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150917/037a631e/attachment.html>

More information about the Haskell-Cafe mailing list