[zeromq-dev] random connect ports causing problems

Ian Barber ian.barber at gmail.com
Sun Mar 11 00:01:34 CET 2012


On Fri, Mar 9, 2012 at 2:21 AM, Justin Karneges <justin at affinix.com> wrote:

> Hi folks,
>
> Today I ran into issues where socket connects were stealing ports that my
> socket binds needed.  I also witnessed what is probably quite rare: a
> socket
> connecting to itself.  At least netstat was showing the source and dest
> ports
> for a single localhost connection as the same.
>
> Probably there should be a way to specify a range of ports to stay within
> when
> connecting as a client, that does not overlap with any ports expected to be
> used by binds.  Any suggestions?
>

This is an entertaining problem (probably not to have :)). If you google
for ephemeral ports you should be able to find out a) how to see which
ports your OS uses, and b) how to change that range. Probably easiest to
just bind outside of that range. (e.g. on osx /sbin/sysctl -a | fgrep
net.inet.ip.portrange shows my mac using 49152 up).

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120310/b2b6504d/attachment.htm>


More information about the zeromq-dev mailing list