Menu

zmq_proxy termination

Blaz Kelbl
2017-02-27
2017-02-27
  • Blaz Kelbl

    Blaz Kelbl - 2017-02-27

    Hi,
    I'm wondering how to handle lvzmq_proxy function when you want to stop it? Closing the socket causes an error, but I know of no other way to terminate it.

    Regards,
    Blaz

     
  • Martijn Jasperse

    Hi Blaz,
    The correct way is to terminate the context that owns the proxy using zmq_ctx_destroy. This will then cause the proxy function to return immediately. Typically you would only want to stop the proxy at exit, in which case having to close all sockets in the context is fine, or you would create a context specifically for the proxy so that it can be terminated as required.

    Cheers,
    Martijn

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.