dingmaotu / mql-zmq

ZMQ binding for the MQL language (both 32bit MT4 and 64bit MT5)
Apache License 2.0
543 stars 298 forks source link

Socket receive timeout #29

Closed mishaxz closed 5 years ago

mishaxz commented 5 years ago

Hello, how can I set the socket receive timeout?

    Context context("abc");
    Socket socket(context,ZMQ_REQ);

    socket.connect(PROTOCOL_ADDRESS);
    socket.send(request);
    PrintFormat("sending request");

    // Get the reply.
    ZmqMsg msg;
    socket.recv(msg);
mishaxz commented 5 years ago

does anyone know? I really can't figure out how to use zmq_setsockopt()

ettoremaiorana commented 5 years ago

SOCKOPT(int,ReceiveTimeout,ZMQ_RCVTIMEO) // milliseconds

mishaxz commented 5 years ago

thank you