[erlang-questions] gen_tcp nonblocking send
Igor Ribeiro Sucupira
igorrs@REDACTED
Fri May 2 22:53:40 CEST 2008
On Fri, May 2, 2008 at 7:53 AM, Per Hedeland <per@REDACTED> wrote:
> "Igor Ribeiro Sucupira" <igorrs@REDACTED> wrote:
> >
>
> >But, how do you deal with the situation (definitely not Daniel's case)
> >in which you just want to NOT send the message if the buffer is full
> >("Oh... system overload... nevermind... I don't want to make the
> >situation worst... I'll come back when I have something
> >important...")? :-)
>
> Well, definitely not by using O_NDELAY/O_NONBLOCK, since they do not (in
> general) provide that functionality - they will let you send however
> much that fits in the send buffer and leave you to deal with the rest.
I meant the "0 byte sent" case.
I have this bad habit of being too brief sometimes. :-)
Igor.
> In fact I don't think there is a portable way to do what you're asking
> about - i.e. basically check whether there is enough buffer space
> without attempting to send anything.
>
> I do think *this* functionality could be useful in Daniel's case though
> - he'd probably prefer to queue and possibly eliminate also the message
> that hit the "buffer full" condition.
>
> --Per
More information about the erlang-questions
mailing list