Regarding the unresponsiveness of the cross-platform network communication server
This article is only to record the problems and solutions I encountered in cross-platform udp communication
1. Problems arise
When performing udp network communication, I use Tencent Cloud Server as the server, and Windows as the client. When connecting, when I send a message from the client to the server, the server cannot receive the message (safety group already configured)
2. Cloud server Centos7 firewall open port
2.1 Check firewall status
sudo firewall-cmd --state
2.2 Turn on the firewall
systemctl start firewalld
2.3 In the running state, add ports that need to be opened to the firewall
sudo firewall-cmd --permanent --zone=public --add-port=8080/udp
sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
2.4 Reload firewall configuration
sudo firewall-cmd --reload
2.5 Check whether the port is released
sudo firewall-cmd --permanent --zone=public --list-ports
When the above command is executed, the red box appears, which means the opening is successful
3. Cloud server firewall configuration open port
3.1 Enter the official website of Tencent Cloud Server, find the instance, and click Firewall
3.2 Add rules
3.3 Add port
Select the protocol type according to the needs, and fill in the port number you want to use for the port.
Run the program again to communicate normally! ! !
Thanks for reading, if it helps you, please like, comment + follow