Skip to content

send has ambiguous error/success return #61

Open
@oblitum

Description

@oblitum
        inline size_t send (const void *buf_, size_t len_, int flags_ = 0)
        {
            int nbytes = zmq_send (ptr, buf_, len_, flags_);
            if (nbytes >= 0)
                return (size_t) nbytes;
            if (zmq_errno () == EAGAIN)
                return 0;
            throw error_t ();
        }

For nbytes == 0 (e.g. for parts with size zero), the return is zero, but it's success. Nonetheless, a zero return is being used to mean EAGAIN.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions