Re: [zeromq-dev] IPC and free ports

2012-10-18 Thread andrea crotti
2012/10/13 Pieter Hintjens piet...@gmail.com: On Oct 12, 2012 6:32 PM, andrea crotti andrea.crott...@gmail.com wrote: But why double binding on IPC doesn't fail, when should that be a good idea? The code explicitly overrides an existing binding on an IPC endpoint so it can recover after a

Re: [zeromq-dev] IPC and free ports

2012-10-18 Thread Pieter Hintjens
On Thu, Oct 18, 2012 at 9:32 PM, andrea crotti andrea.crott...@gmail.com wrote: I think it should or raise a warning saying that the IPC file already exists.. Right. What's the difference between IPC and TCP in terms of recovering after a crash? Maybe the TCP port gets closed anyway and

Re: [zeromq-dev] IPC and free ports

2012-10-14 Thread Michel Pelletier
BTW, I don't know if this is helpful to you (haven't followed this thread very close) but pyzmq has a bind_to_random_port socket method which does the same as your loop code below. https://github.com/zeromq/pyzmq/blob/master/zmq/core/pysocket.py#L114 -Michel On Fri, Oct 12, 2012 at 2:31 AM,

Re: [zeromq-dev] IPC and free ports

2012-10-14 Thread Pieter Hintjens
On Mon, Oct 15, 2012 at 2:45 PM, Michel Pelletier pelletier.mic...@gmail.com wrote: BTW, I don't know if this is helpful to you (haven't followed this thread very close) but pyzmq has a bind_to_random_port socket method which does the same as your loop code below.

Re: [zeromq-dev] IPC and free ports

2012-10-12 Thread andrea crotti
2012/10/11 Ian Barber ian.bar...@gmail.com: On Thu, Oct 11, 2012 at 5:14 PM, andrea crotti andrea.crott...@gmail.com wrote: So suppose I want to make sure that I'm not binding twice, what should I do? Check if the file already exists or? Yep try: sock.bind(addr) except zmq.Error:

Re: [zeromq-dev] IPC and free ports

2012-10-12 Thread Pieter Hintjens
On Oct 12, 2012 6:32 PM, andrea crotti andrea.crott...@gmail.com wrote: But why double binding on IPC doesn't fail, when should that be a good idea? The code explicitly overrides an existing binding on an IPC endpoint so it can recover after a crashed process. There's been discussion before

Re: [zeromq-dev] IPC and free ports

2012-10-11 Thread Ian Barber
On Thu, Oct 11, 2012 at 5:14 PM, andrea crotti andrea.crott...@gmail.com wrote: So suppose I want to make sure that I'm not binding twice, what should I do? Check if the file already exists or? Yep try: sock.bind(addr) except zmq.Error: # loop over until find a free channel