서버프로그래밍

listenSocket SOMAXCONN_HINT(N)

멜데스 2019. 7. 25. 18:24

listen function

  • 12/05/2018
  • 5 minutes to read

The listen function places a socket in a state in which it is listening for an incoming connection.

Syntax

C++Copy

int WSAAPI listen( SOCKET s, int backlog );

Parameters

s

A descriptor identifying a bound, unconnected socket.

backlog

The maximum length of the queue of pending connections. If set to SOMAXCONN, the underlying service provider responsible for socket s will set the backlog to a maximum reasonable value. If set to SOMAXCONN_HINT(N) (where N is a number), the backlog value will be N, adjusted to be within the range (200, 65535). Note that SOMAXCONN_HINT can be used to set the backlog to a larger value than possible with SOMAXCONN.

SOMAXCONN_HINT is only supported by the Microsoft TCP/IP service provider. There is no standard provision to obtain the actual backlog value.

SOMAXCONN_HINT(N)라는 매크로가 하나가 더 있다. 큐 조절 가능