After 6 hours i figured what i made wrong.
In server.cpp
tcpserver->newConnection();
tcpserver->newConnection();
To copy to clipboard, switch view to plain text mode
That line is wrong.
It's should be that
tcpserver->setMaxPendingConnections(1);
//and add this line
tcpserver->setMaxPendingConnections(1);
//and add this line
tcpclient = new QTcpSocket (this);
To copy to clipboard, switch view to plain text mode
@Edit
But now, a message doesn't send to anyone( client->server | server -> client)
mhm...
@Edit 2
Now that i mentioned, if i delete this line
tcpserver->setMaxPendingConnections(1);
tcpserver->setMaxPendingConnections(1);
To copy to clipboard, switch view to plain text mode
message is sending.
But, only with 1 pc :/
If i tried on 2 pc connected to one router, server side get me this:
QIODevice::write (QTcpSocket): device not open
To copy to clipboard, switch view to plain text mode
in Application Output
Any ideas?
Bookmarks