Пример #1
0
 void onClientConnected(FramedTcpConnection *con)
 {
   cout << "Client " << con->remoteHost() << ":"
        << con->remotePort() << " connected, "
        << server->numberOfClients() << " clients connected\n";
   con->frameReceived.connect(mem_fun(*this, &MyClass::onFrameReceived));
 }
Пример #2
0
 void onClientDisconnected(FramedTcpConnection *con,
                           FramedTcpConnection::DisconnectReason reason)
 {
   cout << "Client " << con->remoteHost().toString() << ":"
        << con->remotePort() << " disconnected,"
        << server->numberOfClients() << " clients connected\n";
   /* Don't delete the con object, the TcpServer will do it */
 }