Board index » cppbuilder » Valid Ports

Valid Ports


2005-04-11 02:11:07 AM
cppbuilder9
I have a Client/Server application where on the Server side, I
just leave it up to the administrator to select the port number
which has been working well. I'd just like to know if there is
a way for me to determine ahead of time what the valid port
numbers are before he/she starts my server.
~ JD
 
 

Re:Valid Ports

Not sure (better to wait for Remy :), I know something
for IPv6 (Look for IsPortInUse):
msdn.microsoft.com/library/default.asp
--
Best regards,
Vladimir Stefanovic
"JD" < XXXX@XXXXX.COM >wrote in message
Quote

I have a Client/Server application where on the Server side, I
just leave it up to the administrator to select the port number
which has been working well. I'd just like to know if there is
a way for me to determine ahead of time what the valid port
numbers are before he/she starts my server.

~ JD

 

Re:Valid Ports

"JD" < XXXX@XXXXX.COM >wrote in message
Quote
I'd just like to know if there is a way for me to determine
ahead of time what the valid port numbers are before he/she
starts my server.
The only way to check for availability is to actually try to use the ports.
There are many reasons for a given port to not be available. Even if you
did determine the available ports ahead of time, the availability may change
before you actually try to use the ports. Either way, there is no point in
trying to determine the availability ahead of time because you could just
start the server as-is and let it fail if the desired port is not available
at that time.
Gambit
 

{smallsort}

Re:Valid Ports

"Vladimir Stefanovic" < XXXX@XXXXX.COM >wrote in message
Quote
Not sure (better to wait for Remy :), I know
something for IPv6 (Look for IsPortInUse):
That article only applies to querying the firewall that is built into XP SP1
specifically. That is not a general solution for other systems. It doesn't
even work on XP SP2, for that matter.
Gambit