[zeromq-dev] connect from a different thread

Gaspard Bucher gaspard at teti.ch
Sun Jan 2 11:29:24 CET 2011


PS: I found this
message<http://article.gmane.org/gmane.network.zeromq.devel/6016>
saying
it is ok to create a socket in one thread and then pass it to another but
only in 2.1.0
PPS: I meant "inproc", not "ipc" for the workaround


On Sun, Jan 2, 2011 at 9:59 AM, Gaspard Bucher <gaspard at teti.ch> wrote:

> I have a zmq.SUB socket handling remote messages in thread A. It spends
> most of its time in recv().
>
> Some other thread B running mDNS finds services and I want it to connect
> the subscriber (created in thread A) to the remote end.
>
> Is it ok to connect from a different thread ?
>
> Is it ok to connect while the socket is in recv() ?
>
> If not, one solution I see would be to connect the subscriber to an ipc
> socket (created in the mDNS loop) to receive connection info. Is this the
> way to handle such a pattern ?
>
> Cheers,
>
> Gaspard
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110102/d9110e88/attachment.htm>


More information about the zeromq-dev mailing list