tryonix
asked on
are linux sockets blocking by default
hi everybody,
i am writing a socket class in linux
i am using write and read to write and read from my socket
i have searched for information on whether a socket is blocking by default.
all i can find is that to make a socket nonblocking set the O_NONBLOCK fllag.
so i am assuming that my read on the socket will block by default.
i need to be sure .
can someone tell me is my read on the socke blocking by default
thank you
i am writing a socket class in linux
i am using write and read to write and read from my socket
i have searched for information on whether a socket is blocking by default.
all i can find is that to make a socket nonblocking set the O_NONBLOCK fllag.
so i am assuming that my read on the socket will block by default.
i need to be sure .
can someone tell me is my read on the socke blocking by default
thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I third that ... Linux sockets are blocking by default
ASKER
raven answered first so the points go to him.
thanks guys
thanks guys
- select
- poll
Both these calls allow you to set-up a loop in which you will be waiting for data on a set of sockets (file descriptors in fact).
When returning, they will give you the list of sockets ready for reading, writing, or the ones with pending exceptions.
Using this mechanism, you will be able to handle data only on sockets that will allow you to act without blocking.
man select