CInternetServer::SetClientMoniker Method  
 
INT SetClientMoniker(
  SOCKET hSocket,  
  LPCTSTR lpszMoniker  
);
INT SetClientMoniker(
  LPCTSTR lpszMoniker  
);

Associate a unique string alias 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 which specifies the moniker for the specified client socket. If this parameter is NULL or specifies an empty string, a moniker will no longer be associated with the client session.

Return Value

If the method succeeds, the return value is zero. If the method fails, the return value is INET_ERROR. To get extended error information, call the GetLastError method.

Remarks

A client moniker is a string which can be used to uniquely identify a specific client session aside from its socket handle. The GetClientMoniker 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.

Monikers are not case-sensitive, and they must be unique so that no client socket for a particular server can have the same moniker. The maximum length for a moniker is 127 characters.

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, GetClientHandle, GetClientId, GetClientMoniker