A socket program recently written in python has run with an error:
socket.error: [Errno 10048] normally each socket address (protocol/network address/port) is allowed only once
After searching, it is found that this prompt appears when the port is in conflict. The possible reason is that after a Socket is created in the server program and a port is opened, the Socket is not closed at the end of the program. Therefore, this error prompt will appear next time the program is started.
1, at the end of the server program to close the Socket
2. Or change the port number
3. Restart the machine
Win7 system quickly check the port number and pid process number:
1. Press Win+R key, enter CMD, open the command line.
2. Enter netstat -aon|findstr in the CMD window to indicate the port number you want to see. Take netstat -aon|findstr 80 as an example:
3. As can be seen from the figure below, there is a program occupying port 80. On the far right is the process ID occupying the program: 2996;
4. Knowing the process ID, we just need to find out which program 2996 is. Continue typing the following command: tasklist|findstr “2996”, where 2996 is the previous process ID.
closes the corresponding process
taskkill /F /IM httpd.exe
View port status
netstat -aon
div>
Read More:
- Through PID (process identification) to find the port (port) occupied applications, to solve the problem of port occupied
- nginx: [error] invalid PID number in /var/run/nginx.pid
- nginx: [error] invalid PID number ““ in “/data/nginx/logs/nginx.pid“
- Nginx error: nginx: [error] invalid PID number “” in “/run/nginx.pid”
- View port and resolve port conflict in Windows
- CentOS execution command error: – bash: fork: cannot allocate memory processing / viewing process number
- License Error: “Failed to Open the TCP Port Number in the License” Ultimate Solution
- Mongodb failed to start: child process failed, exited with error number 100
- Mongodb start error: child process failed, exited with error number 1
- Error: child process failed, exited with error number 1
- filezilla Failed to create listen socket on port 21 for IPv4 solution
- Arthas selects PID error and port occupancy error
- The server just without updating PID file and can’t connect to local MySQL server through socket are solved
- Citrix receiver error number 2320
- Port 4200 is already in use.Use ‘-port’ to specify a different port error Reasons
- DirectX error number and its cause
- Idle line number setting and linenumbers modification
- Python judge perfect square number
- Server (for example: HTTP) has a large number of time_ Solutions to wait
- Matlab: Three forms of random number generated (Rand, Randi and Randn)