Exemplo n.º 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()));
}
Exemplo n.º 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()));
}