[zeromq-dev] Client Server Model in Python

Oliver Smith oliver at kfs.org
Tue Aug 24 19:29:19 CEST 2010


Abhishek K said the following on 8/24/2010 12:00 PM:
> The method I was looking for was
>
> class Extended_thread(Threading.thread):
>         def run(a)
>           #some logic
>
> context=zmq.Context()
> socket=context.socket(zmq.REP)
> socket.bind('tcp://127.0.0.1:5555 <http://127.0.0.1:5555/>')
> while True:
>     message=socket.recv()
>            new Extended_thread(socket)

Wait - that's creating a new thread for every message you receive. 
That's going to be incredibly expensive.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100824/8dfafc6a/attachment.htm>


More information about the zeromq-dev mailing list