Changed from using select(...) to using poll(...)