tcpServer = new QTcpServer(this);connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newuser()));tcpServer->listen(QHostAddress::Any, port);qDebug() << tcpServer->isListening() << "TCPSocket listen on port";
class serv : public QObject{ Q_OBJECT ...public slots: void on_starting(); void on_stoping(); void newuser(); void slotReadClient();...
tcpServer->listen(QHostAddress::LocalHost, 7777);
tcpServer->isListening()
C++ (Qt)void CoreServer::newConnection(){ if(hasPendingConnections()){ QTcpSocket *socket = nextPendingConnection(); }}
socket->connectToHost(host, port); if (!socket->waitForConnected()) { return; } ...