1

I am learning ZeroMQ for which I tried to bind it to local host as follows:

void* m_zmqContext;
void* m_zmqSocket;

m_zmqContext = zmq_ctx_new();
unsigned int error_code = zmq_errno();
printf("server ctx error: %u, %s\n", error_code, zmq_strerror(error_code));

m_zmqSocket = zmq_socket(m_zmqContext, ZMQ_REP);
error_code = zmq_errno();
printf("server socket error: %u, %s\n", error_code, 
zmq_strerror(error_code));

zmq_bind(m_zmqSocket, "tcp://127.0.0.1:5555");
error_code = zmq_errno();
printf("server bind error: %u, %s\n", error_code, zmq_strerror(error_code));

This produces output as:

server ctx error: 0, No error
server socket error: 0, No error
server bind error: 19, No such device

An output from netstat -aon | find /i "listening" does not show any process using the port 5555.

How to resolve this issue?

user3666197
  • 1
  • 6
  • 50
  • 92
RKum
  • 758
  • 2
  • 12
  • 33

1 Answers1

0

Q : "How to resolve this issue?"

Step 0 : Proof of having a device at hand :

~$ traceroute 127.0.0.1 --tos=8    \
                        --port=5555 \
                        --queries=9  \
                        --sendwait=9
            
traceroute to 127.0.0.1 (127.0.0.1), 30 hops max, 60 byte packets
 1  localhost (127.0.0.1)  0.030 ms  0.027 ms  0.026 ms  0.028 ms  0.027 ms  0.028 ms  0.024 ms  0.028 ms  0.026 ms

ON FAIL : self evident


ON PASS : file an incident at ZeroMQ maintainers, documenting all respective platform state/details, incl. the ZeroMQ version used, best with your error-reproducible code.

user3666197
  • 1
  • 6
  • 50
  • 92
  • @RKum how did the **[Step 0]** result, Sir? Problem solved? Do not hesitate to post the dichotomy results to the benefit of the Community. – user3666197 Jul 31 '20 at 11:52