[zeromq-dev] assertion failure with master

Martin Lucina mato at kotelna.sk
Mon Nov 8 12:35:25 CET 2010


ph at imatix.com said:
> On Mon, Nov 8, 2010 at 12:20 PM, Martin Lucina <mato at kotelna.sk> wrote:
> 
> > So you're saying a non-blocking send () may simply return with no error and
> > less bytes written?  I guess that makes sense, I was wondering about that
> > case but the POSIX docs were not terribly obvious on this.
> 
> I've never heard of this before.  The Linux man page for send() says:
> "If the message is too long to pass atomically through the underlying
> protocol, the error EMSGSIZE is returned, and the message is not
> transmitted."
> 
> Could that be Linux-specific?

EMSGSIZE also appears to be in the POSIX documentation for send ():

ERRORS
       The send() function shall fail if:
...
       EMSGSIZE
              The message is too large to be sent all at once, as the
              socket  requires.

However, the wording about when send () might fail is kind of vague:

       The length of the message to be sent is specified by the length
       argument. If the message is too long to pass through the underlying
       protocol, send()  shall  fail and no data shall be transmitted.
...
       If space is not available at the sending socket to hold the message
       to be trans‐ mitted,  and  the  socket  file  descriptor does not
       have O_NONBLOCK set, send() shall block until space is available.
       If space is not available at the  sending socket  to  hold  the
       message to be transmitted, and the socket file descriptor does have
       O_NONBLOCK set, send() shall fail. The select() and  poll()
       functions can be used to determine when it is possible to send more
       data.

The general wording there makes me think EMSGSIZE is the case where e.g.
you're trying to send a >64k message down a UDP socket.

Chuck, what system are you on? Linux?

-mato



More information about the zeromq-dev mailing list