Skip to content

ZMQ_CLIENT send not blocking #3248

Closed
Closed
@Cross22

Description

@Cross22

Issue description

Invoking zmq_send() with a ZMQ_CLIENT socket which is NOT connected to a peer causes the message to be queued. Once a peer connects the queued message gets sent. This is in contrast to the documentation which states that send should be blocking when there is no peer.

Sample code

void *context = zmq_ctx_new ();
void *sock = zmq_socket (context, ZMQ_CLIENT);
zmq_connect (sock, "tcp://127.0.0.1:12345");
zmq_send(sock, "HELLO", 6, 0);
printf("Why am I here when no data was sent?");

Environment

  • libzmq version (commit hash if unreleased): 4.2.5
  • OS: OSX

What's the actual result? (include assertion message & call stack if applicable)

Function call returns indicating number of bytes sent.

What's the expected result?

Function blocks until it is able to send the data.

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