System.Win.ScktComp.TCustomServerSocket.OnClientDisconnect

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnClientDisconnect: TSocketNotifyEvent index 3 read GetOnClientEvent

C++

__property TSocketNotifyEvent OnClientDisconnect = {read=GetOnClientEvent, write=SetOnClientEvent, index=3};

Properties

Type Visibility Source Unit Parent
event protected
System.Win.ScktComp.pas
System.Win.ScktComp.hpp
System.Win.ScktComp TCustomServerSocket

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 connection does not close the server socket. The server socket remains open and listening for client requests on its listening connection.

The TServerClientWinSocket that describes the server endpoint of the client connection is freed after OnClientDisconnect. If ServerType is stThreadBlocking, OnThreadEnd occurs after OnClientDisconnect.

Note: If ServerType is stThreadBlocking, make sure that all code in an OnClientDisconnect event handler is thread-safe. Use the GetClientThread method of the Sender parameter to access thread-specific information.

Note: The OnClientDisconnect event handler for TServerSocket is also set when setting the OnClientDisconnect event handler of the associated TServerWinSocket.

See Also