About network programming, the server-client bind error: address already in use:
reason:
1. You used the port number, but the process did not exist.
2. At the end of the process:
crtl +c And crtl + Z are different. The former ends the process and the latter suspends the process
If you use the latter, the process will hang and not be killed
Solution:
1. Kill the process
PS – Aue view PID , Then kill + process PID and kill the process
2. Change the port number
3. Wait half a minute until the port is released
4. External parameter transmission
It is more convenient to directly change the new port number than 2
5. Use the setsockopt() function to cancel the port number binding restriction
int on=1;
setsockopt(fd,SOL_ SOCKET,SO_ REUSEADDR,& on,sizeof(on));
Read More:
- Nginx Error: [emerg] bind() to [::]:80 failed (98: Address already in use)
- Aliyunshield occupies port 80 error: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
- How to Solve Error: Address already in use
- [Solved] Error: listen EADDRINUSE: address already in use :::5000
- Linux: Configure Network address through Netplan
- [Solved] Linux WebService Startup Error: BindException: Cannot assign requested address
- [Solved] Go use zoom to connect DM database and start reporting error in Linux
- [Solved] Win10 and Linux address reading format is different (CV2. Error: opencv (4.2.0)/Io/opencv…)
- linux use sh execute source error [How to Solve]
- [Solved] Web server failed to start. Port 8080 was already in use.
- Linux Use dtc generate dtb Error: “FATAL ERROR: Unable to parse input tree“
- [Solved] Linux — 9 — txt files are copied from windows to Linux and read error
- How to Create Threads in Linux
- The problem of inconsistent host names in building rabbitmq on Linux
- Installation and configuration of redis in Linux
- How to set fixed IP address for Raspberry Pie
- nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
- [Solved] Window Redis Service Failed to Startup: bind No error
- [Solved] Linux Error: mipsel-linux-gcc: fatal error: no input files
- Restart and stop of nginx in Linux service