System.Win.ScktComp.TServerWinSocket.OnClientDisconnect
Delphi
property OnClientDisconnect: TSocketNotifyEvent read FOnClientDisconnect write FOnClientDisconnect;
C++
__property TSocketNotifyEvent OnClientDisconnect = {read=FOnClientDisconnect, write=FOnClientDisconnect};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | public | System.Win.ScktComp.pas System.Win.ScktComp.hpp |
System.Win.ScktComp | TServerWinSocket |
Description
Occurs when one of the connections to a client socket is closed.
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.