c++ Programming Glossary: fd_zero
using QTextStream to read stdin in a non-blocking fashion http://stackoverflow.com/questions/1271784/using-qtextstream-to-read-stdin-in-a-non-blocking-fashion QIODevice ReadOnly QString str forever fd_set stdinfd FD_ZERO stdinfd FD_SET STDIN_FILENO stdinfd struct timeval tv tv.tv_sec..
Example code of libssh2 being used for port forwarding http://stackoverflow.com/questions/1580750/example-code-of-libssh2-being-used-for-port-forwarding channel buf MAX_BUF_LEN if bytes_read 0 FD_ZERO read_set FD_ZERO write_set FD_SET local_sock write_set wait.. channel buf MAX_BUF_LEN if bytes_read 0 FD_ZERO read_set FD_ZERO write_set FD_SET local_sock write_set wait until the socket.. bytes_read bytes_written if bytes_read 0 break FD_ZERO read_set FD_ZERO write_set FD_SET local_sock write_set wait..
C++ Winsock P2P http://stackoverflow.com/questions/2843277/c-winsock-p2p with the FD_xxx functions. receiving data fd_set mySet FD_ZERO mySet FD_SET s mySet loop all your sockets and add to the mySet.. with select . sending data in SOCKET sender fd_set mySet FD_ZERO mySet FD_SET sender mySet timeval zero 0 0 int sel select 0..
Is there a C pre-processor which eliminates #ifdef blocks based on values defined/undefined? http://stackoverflow.com/questions/525283/is-there-a-c-pre-processor-which-eliminates-ifdef-blocks-based-on-values-define
c++ how to use select to see if a socket has closed http://stackoverflow.com/questions/5640144/c-how-to-use-select-to-see-if-a-socket-has-closed #include sys ioctl.h bool isclosed int sock fd_set rfd FD_ZERO rfd FD_SET sock rfd timeval tv 0 select sock 1 rfd 0 0 tv if..
Using select() for non-blocking sockets http://stackoverflow.com/questions/6715736/using-select-for-non-blocking-sockets char 255 int numSent int numRead while 1 waitd.tv_sec 10 FD_ZERO read_flags FD_ZERO write_flags FD_SET new_sd read_flags if strlen.. int numRead while 1 waitd.tv_sec 10 FD_ZERO read_flags FD_ZERO write_flags FD_SET new_sd read_flags if strlen out 0 FD_SET.. char 255 int numRead int numSent while 1 waitd.tv_sec 10 FD_ZERO read_flags FD_ZERO write_flags FD_SET sock read_flags if strlen..
Blocking socket returns EAGAIN http://stackoverflow.com/questions/735249/blocking-socket-returns-eagain if n 0 if errno EINPROGRESS return 1 else if n 0 goto done FD_ZERO rset FD_ZERO wset FD_SET sock rset FD_SET sock wset struct timeval.. EINPROGRESS return 1 else if n 0 goto done FD_ZERO rset FD_ZERO wset FD_SET sock rset FD_SET sock wset struct timeval tval tval.tv_sec..
Sleep less than one millisecond http://stackoverflow.com/questions/85122/sleep-less-than-one-millisecond dummy SOCKET s socket PF_INET SOCK_STREAM IPPROTO_TCP FD_ZERO dummy FD_SET s dummy tv.tv_sec usec 1000000L tv.tv_usec usec..
|