I am trying to learn how to write a non-blocking socket. Can anyone please explain that what roles do ioctl() and fcntl() play in this (i.e. what are the roles of file descriptors in creating a non-blocking socket. A code snippet as an example with explanation will be much appreciated.
Asked
Active
Viewed 919 times
0
-
1possible duplicate of [NON BLOCKING Socket](http://stackoverflow.com/questions/1525050/non-blocking-socket) – Геннадий Казачёк Sep 23 '14 at 08:18
1 Answers
0
You use one or the other to set O_NONBLOCK
. Surely you already discovered that?

user207421
- 305,947
- 44
- 307
- 483
-
Thanks for replying, but yeah, I did. What I exactly want to know is the mechanism as to how it works. :) – Mac Sep 23 '14 at 08:34
-
Meaning what exactly? The mechanism of either is that it puts the socket into non-blocking mode. – user207421 Oct 08 '14 at 11:14
-