A scalable server, this looks like a task for IO Completion Port. My first thought was about ::select(), but that cannot handle a large number of sockets, IIUC.