i have a listening thread like this :
Expand|Select|Wrap|Line Numbers
- void Server::vListeningThread( LPVOID pParam )
- {
- Server *pServer = (Server*)pParam;
- SOCKET socketClient;
- do
- {
- socketClient = accept( *pServer->p_socketServer, 0, 0 );
- if ( socketClient == SOCKET_ERROR || pServer->usNumberOfClients >= pServer->usMAX_CLIENTS )
- {
- // send an error code to client //////////////////////////////////////
- closesocket( socketClient );
- }
- else
- {
- WaitForSingleObject( pServer->handleMutex, INFINITE );
- FD_SET( socketClient, &pServer->fdsetMaster );
- ReleaseMutex( pServer->handleMutex );
- pServer->usNumberOfClients++;
- }
- }while( pServer->bConnected );
- }
does the new socket of data that has been sent go straight into the FD_SET? Therefore when im polling through the set i would have to check if it has been set or not?
Please help, im a little bit confused with this?
thanks