Question about Winsock
-
Hello, I am learning socket programming in windows right now, however, I have some problems with the second parameter when I using this function: listen(socket, int). I don't understand what the second parameter for and how to use it. Thanks for someone to help! Nachi
-
Hello, I am learning socket programming in windows right now, however, I have some problems with the second parameter when I using this function: listen(socket, int). I don't understand what the second parameter for and how to use it. Thanks for someone to help! Nachi
MSDN : int listen ( SOCKET s, int backlog ); backlog [in] The maximum length of the queue of pending connections. If this value is SOMAXCONN, then the underlying service provider responsible for socket s will set the backlog to a maximum "reasonable" value. There is no standard provision to find out the actual backlog value. So its the number of pending connection on the server side, cos a listening socket is on server side! its up to u to know how manny u need in the queue waiting to be served by the server! Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;
-
MSDN : int listen ( SOCKET s, int backlog ); backlog [in] The maximum length of the queue of pending connections. If this value is SOMAXCONN, then the underlying service provider responsible for socket s will set the backlog to a maximum "reasonable" value. There is no standard provision to find out the actual backlog value. So its the number of pending connection on the server side, cos a listening socket is on server side! its up to u to know how manny u need in the queue waiting to be served by the server! Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;
-
I am sorry, what do you mean pending connection? Would you mind to give me an example, let say Iset the blacklog to 3, what will happen? Thanks! Nachi
Pending means waiting inthe queue on server side, let say Iset the blacklog to 3, what will happen? A maximum of 3 will stay in the queue untill they are served! U can accept a conection with the accept function Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;
-
Pending means waiting inthe queue on server side, let say Iset the blacklog to 3, what will happen? A maximum of 3 will stay in the queue untill they are served! U can accept a conection with the accept function Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;