listening socket is responsible 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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.