How to bind a random port using NETMQ from predefined configuration range?.

72 views
Skip to first unread message

raj....@gmail.com

unread,
Aug 1, 2018, 10:55:43 AM8/1/18
to netmq-dev
Hi All,

As part of our requirement we would like to bind a port for TCP socket based on predefined port range.
is there any possible to use NETMQ API to do that ?


Note:
We created a custom logic which will fetch random value from given a range and further we check "it should not be part of any active TCP port list", 
until we get unused port we will continue the above logic.,

But the behaviour was inconsistent we have got port in use exception few times ... 

We can share the code by EOD tomorrow..

Doron Somech

unread,
Aug 1, 2018, 1:10:49 PM8/1/18
to raj....@gmail.com, netmq-dev
Im not sure the OS have this feature. If the OS have it, we can use it.

We do support random port with *, but it is using the OS range

--
You received this message because you are subscribed to the Google Groups "netmq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netmq-dev+...@googlegroups.com.
To post to this group, send email to netm...@googlegroups.com.
Visit this group at https://groups.google.com/group/netmq-dev.
For more options, visit https://groups.google.com/d/optout.

Oren Eini (Ayende Rahien)

unread,
Aug 1, 2018, 2:20:09 PM8/1/18
to Doron Somech, raj....@gmail.com, netmq-dev
You can bind to port 0, and then set the dynamic port range, but that is a OS wide configuration

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Wed, Aug 1, 2018 at 8:10 PM, Doron Somech <somd...@gmail.com> wrote:
Im not sure the OS have this feature. If the OS have it, we can use it.

We do support random port with *, but it is using the OS range
On Wed, Aug 1, 2018, 17:55 <raj....@gmail.com> wrote:
Hi All,

As part of our requirement we would like to bind a port for TCP socket based on predefined port range.
is there any possible to use NETMQ API to do that ?


Note:
We created a custom logic which will fetch random value from given a range and further we check "it should not be part of any active TCP port list", 
until we get unused port we will continue the above logic.,

But the behaviour was inconsistent we have got port in use exception few times ... 

We can share the code by EOD tomorrow..

--
You received this message because you are subscribed to the Google Groups "netmq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netmq-dev+unsubscribe@googlegroups.com.

To post to this group, send email to netm...@googlegroups.com.
Visit this group at https://groups.google.com/group/netmq-dev.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "netmq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netmq-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages