TsgcUDPServerEvents › OnShutdown

OnShutdown Event

Fires once the UDP listener has stopped and no further datagrams will be accepted.

Syntax

property OnShutdown: TNotifyEvent;
// TNotifyEvent = procedure(Sender: TObject) of object

Default Value

Remarks

Fired from Active := False (directly or through Stop/ReStart) after the listener sockets have been closed, the cached DTLS session discarded and the watchdog timer disabled. Use the event to update a status indicator, flush outstanding logs, or release any resources that were held while the server was up. The thread that fires the event depends on the NotifyEvents property; the default for the server is neNoSync so the handler runs on the worker thread that performed the transition.

Example

procedure TForm1.oServerShutdown(Sender: TObject);
begin
  Memo1.Lines.Add('UDP server stopped');
end;

Back to Events