[erlang-questions] 0MQ libraries

Andreas Schultz aschultz@REDACTED
Fri Jan 31 18:43:38 CET 2014


----- Original Message -----
> On Fri, Jan 31, 2014 at 9:44 AM, Andreas Schultz <aschultz@REDACTED> wrote:
> > I got stuck when trying to control the queuing behavior on tcp socket,
> > gen_tcp hides too much details of the underlying socket and the buffering
> > in it also doesn't help.
> >
> Can you remember what specifically your problem was? What controls do you
> need on the socket in order for it to behave "correctly"? What do you mean
> by queueing behaviour? What do you mean by buffering?

gen_tcp buffers data internal (in the inet code) when it can't sent it immediately,
I haven't found a way to query to amount of data buffered or force a flush of the

My specific problem was that after a connection abort, I would not know how
many of the previous messages where actually sent.
It can happen that there are for example 1000 messages buffered in gen_tcp when
it decides that the remote side has died. As far as I understood the 0MQ semantics,
I should then try to reestablish the connection and transmit the pending messages.
Without knowing how much was buffered in gen_tcp, that is not possible.


> --
> J.

Dipl. Inform.
Andreas Schultz

More information about the erlang-questions mailing list