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 :
Expand|Select|Wrap|Line Numbers
1. void Server::vListeningThread( LPVOID pParam )
2. {
3. Server *pServer = (Server*)pParam;
4. SOCKET socketClient;
5. do
6. {
7. socketClient = accept( *pServer->p_socketServer, 0, 0 );
8.
9. if ( socketClient == SOCKET_ERROR || pServer->usNumberOfClients >= pServer->usMAX_CLIENTS )
10. {
11. // send an error code to client //////////////////////////////////////
12. closesocket( socketClient );
13. }
14. else
15. {
16. WaitForSingleObject( pServer->handleMutex, INFINITE );
17. FD_SET( socketClient, &pServer->fdsetMaster );
18. ReleaseMutex( pServer->handleMutex );
19. pServer->usNumberOfClients++;
20. }
21.
22. }while( pServer->bConnected );
23.
24. }
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