On the client I create a QTcpSocket *ClientSocket = new QTcpSocket(this);
ClientSocket ->bind(this computer's ip address, 33336)
ClientSocket ->connectToHost(server ip address, 33333)
The Server then kicks in by connecting newConnection
QTcpSocket *ServerSocket = TcpServer->nextConnection();
The client and server are on the same network.
if I look at the data
qdebug << ServerSocket->peerPort();
the port number is random.
How do I make the client bind to a specific port?
Bookmarks