Inside the read FD_SET
I have several sockets:
- the main socket listening for new connections
- accepted sockets listening for incoming data.
I set the timeout for 30 seconds and called select()
. I quickly noticed the behavior is different for each:
- When a new client connects on the listening port, it returns immediately from blocking.
- When an already connected client sends a message, it blocks for the entire 30 seconds.
Is there a way I can make it return immediately in the second case?