c++ select async programming -


is there way have 'select' waiting reads , writes, while being able add new file descriptors? preferrably on 1 thread?

now know scenario (a socket-based server may want accept new incoming connections), did know can append file-descriptor listening socket list select? see e.g. http://www.lowtek.com/sockets/select.html.

(paraphrased example:)

fd_set socks;  fd_zero(&socks);  // add listener socket listen(sock, n); fd_set(&socks, sock);  // add existing socket connections (i = 0; < num_existing_connections; i++) {     fd_set(&socks, connection[i]); }  // break if of existing connections active, // or if new connection appears. select(..., &socks, ...); 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -