Occurs immediately before the connection closes.
property AfterDisconnect: TNotifyEvent;
Write a BeforeDisconnect event handler to take application-specific actions before dropping a connection.