[zeromq-dev] Sender getting EAGAIN even though client is receiving message
Doron Somech
somdoron at gmail.com
Tue Dec 2 22:20:48 CET 2014
send return the number of bytes sent, so it is always different from zero,
you want to check if result is different from minus 1.
On Tue, Dec 2, 2014 at 11:16 PM, Thomas Johnson <thomas.j.johnson at gmail.com>
wrote:
> I have a PUSH/PULL socket set up where the pusher is a C++ application and
> the puller is a Python application. Both are using ZMQ 4.0.4.
>
> The C++ pusher sends with this code:
>
>
> static int s_send (zmq::socket_t & socket, const std::string & string) {
> zmq::message_t message(string.size());
> memcpy (message.data(), string.data(), string.size());
> int rc = socket.send (message);
> return rc;
> }
> ....
> int result = s_send(*_to_client_socket, message);
> while(result != 0 && zmq_errno() == EAGAIN) {
> LOG(WARNING) << "Re-sending message to client after getting EAGAIN: "
> << message;
> result = s_send(*_to_client_socket, message);
> }
> ...
>
> The C++ sender is looping indefinitely in that re-sending block, but the
> Python receiver is getting a constant stream of re-sent messages. Am I
> doing error handling wrong somehow?
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20141202/5817026e/attachment.htm>
More information about the zeromq-dev
mailing list