Current location - Quotes Website - Team slogan - How to check the occupation of Socket port in Windows operating system?
How to check the occupation of Socket port in Windows operating system?
Start-Run-cmd Enter the command prompt, and enter netstat -ano to view the PID of all connections. Then find the program corresponding to this PID in the task manager. If there is no PID in the task manager, you can choose View-Select Column in the task manager.

Often when we start the application, we find that the ports needed by the system are occupied by other programs. How to know who has the port we need is a headache for many people. Here is a very simple method, I hope it will be useful to everyone.

If we need to determine who is occupying our 9050 port.

1, Windows platform

Execute in a windows command line window:

1. View all port occupancy.

c:\ & gt; netstat -ano

Protocol local address external address state PID

TCP127.0.0.1:1434 0.0.0: 0 Listening to 3236

TCP127.0.0.1:5679 0.0.0: 0 Monitoring 4 168

TCP127.0.0.1:7438 0.0.0: 0 Monitoring 4 168

Tcp127.0.01:80150.0.0: 0 monitoring 1456.

TCP192.168.3.230:139 0.0.0: 0 Listening 4

TCP192.168.3.230:1957 220.181.31.225: 443 Establish 3068.

TCP/KOOC-0/92./KOOC-0/68.3.230: 2020/KOOC-0/83.62.96./KOOC-0/89:/KOOC-0/522 Establishment/KOOC-0/456.

TCP192.168.3.230: 292717.79.91.18: 80 has established 4732.

TCP192.168.3.230: 292917.79.91.18: 80 has established 4732.

TCP192.168.3.230: 293017.79.91.18: 80 has established 4732.

TCP192.168.3.230: 2931117.79.91.18: 80 has established 4732.

2. Check the occupation of the specified port.

c:\ & gt; netstat -aon|findstr "9050 "

Protocol local address external address state PID

TCP127.0.0.1:9050 0.0.0: 0 Monitoring 20 16

P: Yes, the port is occupied by the process with the process number of 20 16. Continue to execute the following command: (You can also view the process corresponding to pid in Task Manager).

3. Check the process corresponding to PID.

c:\ & gt; tasklist|findstr "20 16 "

Image Name PID Session Name Session Number Memory Usage

========================= ======== ================

Tor.exe 2016 console 0 16064K

P: It is obvious that tor is occupying your port.

4. End the process

c:\ & gt; Taskkill/f/t/im tor.exe returns to Bitnet's home page >>