HttpGetClientThreadId Function  
 
DWORD WINAPI HttpGetClientThreadId(
  HSERVER hServer,  
  UINT nClientId  
);

Returns the thread ID associated with the specified client session.

Parameters

hServer
The server handle.
nClientId
An unsigned integer which uniquely identifies the client session.

Return Value

If the function succeeds, the return value is a thread ID. If the function fails, the return value is zero. To get extended error information, call the HttpGetServerError function.

Remarks

The HttpGetClientThreadId function returns a thread ID that can be used to identify the thread that is managing the client session. The thread ID can be used with other Windows API functions such as OpenThread. Exercise caution when using thread-related functions, interfering with the normal operation of the thread can have unexpected results. You should never use this function to obtain a thread handle and then call the TerminateThread function to terminate a client session. This will prevent the thread from releasing the resources that were allocated for the session and can leave the server in an unstable state. To terminate a client session, use the HttpDisconnectClient function.

Requirements

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

See Also