all groups > dotnet general > august 2003 >
You're in the

dotnet general

group:

how to dynamically allocate and advertise port numbers by name



how to dynamically allocate and advertise port numbers by name B or T
8/23/2003 7:46:32 PM
dotnet general: 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?

Re: how to dynamically allocate and advertise port numbers by name Herman Eldering
8/24/2003 3:47:38 AM
Hi,

[quoted text, click to view]

For most applications/protocols this is the way things work. (ie. protocols
HTTP/POP3/IMAP/FTP/SSH and applications MSN messenger/games/remote desktop)

[quoted text, click to view]

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

Herman Eldering

AddThis Social Bookmark Button