listening socket is responsib开发者_如何学Cle for accepting new coming client socket :
sock_client = accept(sock_listen, NULL, NULL)
In a typical C/S application,what's the best choice of blocking mode of listening socket and client socket?
If you are threaded and can devote a thread to a socket, then blocking. If you are not, then on the server non-blocking. On the client it depends if you have something better to do. Blocking if not, non-block if you do.
精彩评论