CInternetServer::GetClientHandle Method  
 
SOCKET GetClientHandle(
  UINT nClientId  
);

Returns the handle for a specific client session based on its ID number.

Parameters

nClientId
An unsigned integer value which uniquely identifies the client session.

Return Value

If the method succeeds, the return value is the socket handle for the specified client session. If the method fails, the return value is INVALID_SOCKET. To get extended error information, call GetLastError.

Remarks

Each client connection that is accepted by the server is assigned a unique numeric value called the client ID. The GetClientHandle method will return the socket handle that is associated with the specified client ID. Unlike socket handles, which are reused by the operating system, the client ID is guaranteed to be unique throughout the lifetime of the server. To obtain the ID associated with the client session, use the GetClientId method.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include cswsock10.h
Import Library: cswskv10.lib

See Also

GetClientId, GetClientMoniker, SetClientMoniker, GetThreadClient