InetGetClientHandle Function  
 
SOCKET WINAPI InetGetClientHandle(
  SOCKET hServer,  
  UINT nClientId  
);

The InetGetClientHandle function returns the handle for a specific client session based on its ID number.

Parameters

hServer
Handle to the server socket.
nClientId
An unsigned integer value which uniquely identifies the client session.

Return Value

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

Remarks

Each client connection that is accepted by the server is assigned a unique numeric value. This value can be obtained by calling the InetGetClientId function and used by the application to identify that client session. The InetGetClientHandle function can then be used to used to obtain the client socket handle for the session, based on that client ID.

The socket handle for the server must be one that was created by calling the InetServerStart function, and cannot be a socket that was created using the InetListen or InetListenEx functions.

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

InetGetClientId, InetGetClientMoniker, InetSetClientMoniker, InetGetServerClient, InetGetThreadClient