Example #1
0
void Widget::tcpConnectClient()
{
    logMessage("TCP: New client connected");

    QTcpSocket *newClient = tcpServer->nextPendingConnection();
    tcpClientsList << newClient;

    connect(newClient, SIGNAL(readyRead()), this, SLOT(tcpProcessPendingDatagrams()));
    connect(newClient, SIGNAL(disconnected()), this, SLOT(tcpDisconnectClient()));
}
Example #2
0
void Widget::tcpConnectClient()
{
#if DEBUG_LOG
    logMessage("TCP: New client connected");
#endif

    QTcpSocket *newClient = tcpServer->nextPendingConnection();
    tcpClientsList << QPair<QTcpSocket*,QByteArray*>(newClient,new QByteArray());

    connect(newClient, SIGNAL(readyRead()), this, SLOT(tcpProcessPendingDatagrams()));
    connect(newClient, SIGNAL(disconnected()), this, SLOT(tcpDisconnectClient()));
}