RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TServerWinSocket.OnClientDisconnect Event

Occurs when one of the connections to a client socket is closed.

Pascal
property OnClientDisconnect: TSocketNotifyEvent;
C++
__property TSocketNotifyEvent OnClientDisconnect;

Write an OnClientDisconnect event handler to take specific action when the connection to a client socket is ending. The termination of a client request does not close the listening socket. The listening connection remains open for accepting new client connection requests. 

The TServerClientWinSocket object associated with the client connection is freed after OnClientDisconnect. If ServerType is stThreadBlocking, OnThreadEnd occurs after OnClientDisconnect. 

The Sender parameter is the TServerWinClient object that received the client request. The Socket parameter is the TServerClientWinSocket object that is ending a connection with the client socket.

Note: If ServerType is stThreadBlocking, make sure that all code in an OnClientDisconnect event handler is thread-safe.Use the GetClientThread method to access thread-specific information.
The OnClientDisconnect event handler for TServerWinSocket is also set when setting the OnClientDisconnect event handler of the associated TServerSocket

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!