CHttpServer::GetClientVirtualHostId Method  
 
UINT GetClientVirtualHostId(
  UINT nClientId  
);

Return the virtual host ID associated with the specified client session.

Parameters

nClientId
An unsigned integer which uniquely identifies the client session.

Return Value

An unsigned integer value which specifies the virtual host ID. If the method fails, the return value will be INVALID_VIRTUAL_HOST and the GetLastError method can be used to retrieve the last error code.

Remarks

The GetClientVirtualHostId method is used to obtain the virtual host ID associated with the hostname the client used to establish a connection with the server. This method should not be called inside an OnConnect event handler because the virtual host has not been selected at that point. If the virtual host ID is not available at the time this method is called, the method will return INVALID_VIRTUAL_HOST and the last error code will be set to ST_ERROR_VIRTUAL_HOST_NOT_FOUND.

The GetClientVirtualHost method can be used to obtain the hostname that the client used to establish the connection.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: cshtsv11.lib

See Also

GetClientVirtualHost, GetCommandUrl, GetVirtualHostId