Hello, please tell me, I'm trying to create a "chat client" . I got to the point where I create a server and go to the client itself from the first computer.
But my problem is that when I connect the second computer to the created server (который запущен на первом компьютере) , the connection does not occur .
It turns out this situation:
(server running)
On the first computer:
On the second: But connecting (launching only the client), Connect does not occur. Port number and localhost remain the same when connected. To add a connection to the "server":
void Widget::addConnection() { QTcpSocket* connection = server->nextPendingConnection(); connections.append(connection); //Them ket noi vao danh sach QBuffer *buffer = new QBuffer(this); //Tao bo dem du lieu cho connection nay buffer->open(QIODevice::ReadWrite); buffers.insert(connection, buffer); //Luu vao danh sach connect(connection, SIGNAL(disconnected()), this, SLOT(removeConnection())); connect(connection, SIGNAL(readyRead()), this, SLOT(receiveMessage())); } I do not know how best to show the code, so that it is easier to understand and to help you solve the problem. I'll post it like this:
Server:
https://www.dropbox.com/sh/vilapm4sr1laimi/AAD5G0USlLf5UayQq2zHb9ZUa?dl=0
Customer:
https://www.dropbox.com/sh/fx9jtzvtmeepzry/AABcDbvFU4ha4skHQP9AxK1la?dl=0
I collect on Qt 5.3 under Windows.


localhost, this is at least. At the same time, check if the correct port is open on both machines. - Streletz