select() not suitable for asynchronous I / O under Windows. unfortunately, calling select() on windows only works with socket descriptors, not pipe or fie handles.
You should take a look at overlapping I / O.
using an event in your overlapping structure you can have behavior close to select() . any event on the socket raises an event that you can expect using WaitForMultipleObjects() . Now your GUI thread can signal an I / O stream by specifying a specific (separate) event that you create with a call to CreateEvent() .
source share