hi. ok my problem is that i have been using TCP for a while and now i want to change to UDP. Im using the select I/0 method.
i have a listening thread like this :
-
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 );
-
-
}
now im unsure how to change it into UDP.
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