Home > other >  Ubuntu system development client server system
Ubuntu system development client server system

Time:10-13

Because of academic requirements, now need to under the Ubuntu system using c language to develop a client and the server, the basic, use socket programming, TCP communications, in the client program followed by 127.0.0.1 as server IP address, which is the unit tests pass, can normal communication, but when the client and the server after separated on the two computers, two computer equipped with the same version of Ubuntu, not virtual machine), the client connect to the server failure, check for a long time, found that is a port is not open, the firewall on the server is off by default, the client use nc command to test port to fail, and then activate the firewall, sudo ufw enalbe; Sudo ufw allow port; Two commands open communication port, and sudo ufw allos client IP, try, again use nc test port is still fail,
Now progress is port test fail, hope to have this problems or are interested in this aspect to understand or can help, thank you very much,

CodePudding user response:

Tested in the morning, the server side: nc - 12306 l (communication port), the client: nc 192.168.43.71 (server IP) 12306, can be normal use nc chat function
  • Related