Use poll instead of select to avoid FD_SETSIZE limit