By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,441 Members | 998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,441 IT Pros & Developers. It's quick & easy.

how to dynamically allocate and advertise port numbers by name

P: n/a
How do you dynamically allocate a port number (assured that it is not
already in use), and advertise it (by name or ID)?

Every book I come across seems to hard code/configure a specific port
number. This obviously won't work in general, if different applications try
to grab the same ports, or if multiple instances of the application are
running on the same machine (such as two instances of a client program
requiring callback connections).

On other platforms this is done by a "port broker". Is there a standard
port brokers in .net (or accessible to .net) for dynamically allocated port
numbers? Would system.directoryServices be the place to look?
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

"B or T" <80*******@sympatico.ca> wrote in message
news:i1*******************@news20.bellglobal.com.. .
How do you dynamically allocate a port number (assured that it is not
already in use), and advertise it (by name or ID)?

Every book I come across seems to hard code/configure a specific port
number. This obviously won't work in general, if different applications try to grab the same ports, or if multiple instances of the application are
running on the same machine (such as two instances of a client program
requiring callback connections).
For most applications/protocols this is the way things work. (ie. protocols
HTTP/POP3/IMAP/FTP/SSH and applications MSN messenger/games/remote desktop)
On other platforms this is done by a "port broker". Is there a standard
port brokers in .net (or accessible to .net) for dynamically allocated port numbers? Would system.directoryServices be the place to look?


It can indeed give problems but I am not aware of any port brokers in the
Base Class Library.

Herman Eldering
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.