in reply to Problem with non-blocking sockets example from Cookbook - send() vs EWOULDBLOCK

You might be falling foul of a restriction in the transport as described in the send(2) manpage:

If the message is too long to pass atomically through the underlying protocol, the error EMSGSIZE is returned, and the message is not transmitted.
You might try seeing what value $! is set to in the case of your failure.

/J\

  • Comment on Re: Problem with non-blocking sockets example from Cookbook - send() vs EWOULDBLOCK

Replies are listed 'Best First'.
Re: Re: Problem with non-blocking sockets example from Cookbook - send() vs EWOULDBLOCK
by macdee_2 (Initiate) on Jan 21, 2004 at 01:04 UTC
    $! is not set at all, either in string form ("$!") or numerical form. The return value is set to the length that did send (not all of it).

    I'm asking if the return value from send(2) will always be -1 if Errno is set, or are there cases where an Errno can be set, yet some data still sent. I don't think there is, yet the Cookbook code suggests that EWOULDBLOCK is such a case. My testing shows this to be incorrect (at least on Linux).

    If I generates a script that provided the example case, would people test it on their platform?

    Macdee