CInternetServer::GetClientMoniker Method  
 
INT GetClientMoniker(
  SOCKET hClient,  
  LPTSTR lpszMoniker,  
  INT nMaxLength  
);
INT GetClientMoniker(
  SOCKET hClient,  
  CString& strMoniker  
);

The GetClientMoniker method returns the moniker associated with the specified client session.

Parameters

hSocket
An optional parameter that specifies the handle to the client socket. If this parameter is omitted, the socket handle for the active client session will be used. If this method is called outside of a server event handler, the socket handle must be specified.
lpszMoniker
Pointer to a string buffer that will contain the moniker for the specified client session when the method returns. An alternate version of this method accepts a CString object if it is available.
nMaxLength
The maximum number of characters that may be copied into the string buffer. The buffer must be large enough to store the moniker and a terminating null character. The maximum length of a moniker is 127 characters.

Return Value

If the method succeeds, the return value is the number of characters in the moniker string. A return value of zero specifies that no moniker was assigned to the socket. If the method fails, the return value is INET_ERROR. To get extended error information, call GetLastError.

Remarks

A client moniker is a string which can be used to uniquely identify a specific client session aside from its socket handle. A moniker can be assigned to the client session using the SetClientMoniker method. This method will return the moniker that was previously assigned to the client, if any. To obtain the socket handle associated with a given moniker, use the FindClient 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

FindClient, GetClientId, SetClientMoniker