[zeromq-dev] EAGAIN zmq_recv with no flags set

Trevor Bernard trevor.bernard at gmail.com
Sun Feb 17 00:11:54 CET 2013


I'm receiving an EAGAIN error on the following bit of code.

JNIEXPORT jint JNICALL
Java_org_zeromq_ZMQ_00024Socket_recvZeroCopy (JNIEnv *env,

      jobject obj,

      jobject buffer,

      jint length,

      jint flags)
{
    void* sock = get_socket (env, obj, 0);
    jbyte* buf = 0;
    int ret = 0;
    buf = (jbyte*) env->GetDirectBufferAddress(buffer);
    ret = zmq_recv(sock, buffer, length, flags);

    printf("errno: %d\n", zmq_errno());
    printf("EAGAIN:%d\n", EAGAIN);

    if(zmq_errno() == EAGAIN)
        return 0;
    return ret;
}

I didn't request a non-blocking mode.

I might have uncovered a bug as well. If the socket is REQ, I get a
EFSM error if I try to send again using after my EAGAIN.

-Trev



More information about the zeromq-dev mailing list