Reputation: 1876
I've made a simple C++ program to start working with 0MQ. I have two applications: A server (with a binding publisher socket) and a client (with a connecting subscriber) socket. The server program is pulled and ran from a remote machine -- let's call it example.com.
ZMQ is producing an EAGAIN when the server sends a simple string message with no flags. I know this by viewing the ZMQ CPP binding I'm using; The socket_t::send() function returns false only when this error is raised. I am not using the function that returns an integer, I am certain the return value is boolean false.
The functionality persists when the client is running and connected. The machine has all incoming and outgoing ports open.
Why would ZMQ produce this error? In particular, EAGAIN should only be raised in non-blocking mode, but I specifically never ask for this mode. Is this a functionality of a publisher socket?
Upvotes: 1
Views: 852
Reputation: 1216
The PUB socket shall never block when sending messages. See the socket reference That means that if the message can't be sent you'll get the EAGAIN. I surmise there aren't any connected subscribers.
Upvotes: 0