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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
George GeorgePosted May 19, 2008, 2:34 AM
Thanks,
Question answered. :-)
regards,
George
Johnny GCPosted May 19, 2008, 1:25 AM
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 ;)