Example #1
0
void *ConnectToClient(void* server)
{
    CServerSocket *serverObj = static_cast<CServerSocket *>(server);

    while(1)
    {
        cout << "Waiting for new client\n";
        if(serverObj->ConnectClient())
            cout << "Connected to client and assigned id: " << serverObj->clientId - 1 << endl;

        else
            cout << "Cannot connect to client\n";
    }

    pthread_exit(NULL);
}