Impact of using select with blocking and non-blocking sockets

8.1k views Asked by At

How will my program differ in behavior if I use non-blocking sockets with a select() call as opposed to using blocking sockets with a select() call?

2

There are 2 answers

1
Some programmer dude On

The select polling will not behave differently, only the receive/send functionality will differ between blocking/non-blocking sockets.

0
alecov On

select() won't behave differently. read(), write(), accept() and other I/O functions will -- they will never block on non-blocking sockets, while they might block even if select() tells they would not, although this is somewhat rare.

https://stackoverflow.com/a/5352634/259543

Not sure whether this behavior is allowed by POSIX, though.