TsgcUDPServer › Events › OnShutdown
Fires once the UDP listener has stopped and no further datagrams will be accepted.
property OnShutdown: TNotifyEvent;
// TNotifyEvent = procedure(Sender: TObject) of object
—
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.
procedure TForm1.oServerShutdown(Sender: TObject);
begin
Memo1.Lines.Add('UDP server stopped');
end;