开发者

Best practice for blocking mode of listening socket and client socket?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜