c++ Programming Glossary: set_nonblock
BSD Sockets - How to use non-blocking sockets? http://stackoverflow.com/questions/6699488/bsd-sockets-how-to-use-non-blocking-sockets is below server code struct sockaddr name char buf 80 void set_nonblock int socket int flags flags fcntl socket F_GETFL 0 assert flags.. 0 cout nserver accept failure errno exit 1 set nonblock set_nonblock new_sd char in new char 80 std string out Got it int numSent.. normally n return 0 client code struct sockaddr name void set_nonblock int socket int flags flags fcntl socket F_GETFL 0 assert flags..
Using select() for non-blocking sockets http://stackoverflow.com/questions/6715736/using-select-for-non-blocking-sockets PORT 4950 #define STDIN 0 struct sockaddr name void set_nonblock int socket int flags flags fcntl socket F_GETFL 0 assert flags.. if new_sd 0 printf nAccept error m errno exit 1 set_nonblock new_sd cout nSuccessful Connection char in new char 255 char.. an accept call #define PORT 4950 struct sockaddr name void set_nonblock int socket int flags flags fcntl socket F_GETFL 0 assert flags..
|