Help is needed. I deal with the network on Qt using QTcpServer QTcpSocket. I took http://qt-doc.ru/model-klient-server.html as a basis for this example; it also sorted it out in many places. It compiles and works, but only if you run everything on one computer. When changed to MyClient client("kor4", 2324); or MyClient client ("192.168.1.12", 2324); does not work.

I think that it's not so much in the code but in the network. I start the Server on win7 (opened port 2324) ip set the following way 192.168.1.14 mask 255.255.255.0 gateway 192.168.1.1 (I don’t know why but enabled telnet) The client on xp ip set the following way 192.168.1.12 mask 255.255.255.0 192.168.1.1

Connected D-Link2540u route mode. Firewalls disabled Ping goes.

Sources can pour. Specify the direction where to drip. (Already a lot of things shoveled) PS Not very "rummage in the network." ps is on a computer with 7 Ubuntu (just started to switch to linux full noob) Thank you in advance.

HERE THE SOURCES OF THE EXAMPLE http://zalil.ru/33427542 If someone has 2 computers and compile free time and check. In the client’s source in the constructor, change "localhost" to strHost (example rules and forgot to return)

I don’t know what helped but 1 changed itself ip 2 recompiled 3 overloaded 4 killed all that antivirus could, etc. created a rule that serves the port and removed the tick from NAT (although I’ve done this more than once)

The question can be deleted by all thanks.

  • And why, if the server is 192.168.1.14, then in the code you have MyClient client ("192.168.1.12", 2324); - Dex
  • I was wrong here - Partizan

1 answer 1

I correctly understood: the server under Win7, and the client under WinXP? Ping to the Win7 server responds, and the server program does not provide an echo? Judging by the problem in the network security settings in Win7, you need to allow the client to receive data (or the server to send data to the appropriate client). And Ping, on the fly, should go through this network configuration.

  • There is a ready-made example. I'm just learning how to work with networks and sockets. So this example does not work if it is launched as it should be on different "machines", if it is run on one computer, it works. - Partizan
  • one
    Then check your client-server program on identical platforms (WinXP). If everything is fine, the problem is in the Win7 security settings; if it does not work, the problem is in the code. If you can register your echo daemon in Linux and make it work, you are just great! - Vyacheslav Kirichenko