QTcpServer *tcpServer;tcpServer = new QTcpServer(this);if(!tcpServer->listen(HostXXX,45454)) "Error connection" else "ОК"
QTcpSocket *tcpSocket;tcpSocket->connectToHost(HostXXX, 45454);
QTcpSocket *clientConnection = tcpServer->nextPendingConnection();QMessageBox::information(this,"s",tr("%1").arg(clientConnection->localPort()));
QTcpSocket *clientConnection = tcpServer->nextPendingConnection();QMessageBox::information(this,"s",tr("%1 %2").arg(clientConnection->localPort()).arg(clientConnection->peerPort()));