Click here to Skip to main content
15,906,625 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everybody,
I need help please.
I use C++ CURL library to make http connections:

But i wanted to check if the some port is already in use or not.

I googled it but unfortunately couldn't find any answer.

Thanks in advance.
Posted

1 solution

To check if a port is currently in use on a Windows machine:
1)Start Command Prompt.
2)In the command console enter:
netstat -ano | findstr portNumber
This lists any processes where the port number is included somewhere on the line.
Make a note of the number at the end of the line. This is the process ID (PID).
Run the task-list program for this PID:
tasklist | findstr PID

Also check This[^], it will help you.
 
Share this answer
 
v2
Comments
sourabhmehta 20-Jun-12 5:44am    
Thanks for the response.
but i was asking in context of Curl.
stib_markc 20-Jun-12 6:21am    
Do you want to find out the port's availability through a program?
sourabhmehta 16-Sep-15 1:39am    
Yes, exactly

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900