ClientThread Property  

Return the thread ID for the active client session.




The ClientThread property returns the thread ID for the current client session. Until the thread terminates, the thread identifier uniquely identifies the thread throughout the system. This property only returns a meaningful value when accessed from within an event handler, or a function that has been called from within an event handler.

The thread ID can be used with 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 property value 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 Disconnect method.

Data Type

Integer (Int32)

See Also

ClientId Property, ServerThread Property