Home > Mobile >  QTcpServer and QtcpSocket, communication links
QTcpServer and QtcpSocket, communication links

Time:12-02

The client and server written in qt

Listen I write of a service is a server - & gt; Listen (QHostAddress: : Any, 8888);
The client socket connection - & gt; ConnectToHost (QHostAddress (IP), 8888);

I'm on my own computer to open the server and the client, the client can connect to the server, but when I go up someone else's computer with clients to connect my server (in my computer has been open), even, I also changed the IP (I IP directly out of the IP) on baidu, I take the past, the service side directly connect the computer is not opened, and the port of the client or not, only the client and the server are on my computer to connect, how to solve this problem, just learning qt soon, for the first time contact network communication, search on the Internet a lot, didn't find how to solve,

CodePudding user response:

First of all, the two computers to ping

CodePudding user response:

Within the local area network (LAN) connection, or Internet connection?
May be a firewall (firewalls and local computer firewall router)

CodePudding user response:

The Internet even impassability, LAN can pass

CodePudding user response:

Internet unicom need public IP, LAN internal IP can only apply to local area network (LAN)

CodePudding user response:

Follow to learn
  •  Tags:  
  • Qt
  • Related