Hello everyone,
How to check whether a port on the local machine is occupied by another thread/process? (only whether or not occupied is ok, no need to know which party occupied the port.)
Any samples or APIs to use?
thanks in advance,
George
Hello everyone,
How to check whether a port on the local machine is occupied by another thread/process? (only whether or not occupied is ok, no need to know which party occupied the port.)
Any samples or APIs to use?
thanks in advance,
George
Know the answer? Post it. Somebody with the same question will find it here.
Johnny GC44 pointsPosted May 18, 2008, 9:25 PM EDT
try to bind the socket to a local end point and if it throws exception the port is used, don`t worry about opening the socket, bind does not listen yet, you have to call other functions for that ;)
George GeorgeRank #2,261 · 618 pointsPosted May 18, 2008, 10:34 PM EDT
Thanks,
Question answered. :-)
regards,
George