void CServerApp::handleClientConnected(const CEvent&, void* vlistener) { CClientListener* listener = reinterpret_cast<CClientListener*>(vlistener); CClientProxy* client = listener->getNextClient(); if (client != NULL) { s_server->adoptClient(client); updateStatus(); } }
void NetworkTests::sendToClient_mockFile_handleClientConnected(const CEvent&, void* vlistener) { CClientListener* listener = reinterpret_cast<CClientListener*>(vlistener); CServer* server = listener->getServer(); CClientProxy* client = listener->getNextClient(); if (client == NULL) { throw runtime_error("client is null"); } CBaseClientProxy* bcp = reinterpret_cast<CBaseClientProxy*>(client); server->adoptClient(bcp); server->setActive(bcp); server->sendFileToClient(kMockFilename); }
void CServerApp::handleClientConnected(const CEvent&, void* vlistener) { CClientListener* listener = reinterpret_cast<CClientListener*>(vlistener); CClientProxy* client = listener->getNextClient(); if (client != NULL) { s_server->adoptClient(client); updateStatus(); if (args().m_enableVnc) { // TODO: figure out client IP address from name. CVncClient* vncClient = new CVncClient("192.168.0.13", client->getName()); vncClient->start(); m_vncClients.insert(std::pair<CString, CVncClient*>(client->getName(), vncClient)); } } }