TsgcSTUNServer › Events › OnSTUNException
Raised when an unhandled exception is caught while parsing or responding to a STUN message.
property OnSTUNException: TsgcSTUNExceptionEvent;
// TsgcSTUNExceptionEvent = procedure(Sender: TObject; E: Exception) of object
—
Fired when the STUN stack traps an exception while decoding a datagram, verifying MESSAGE-INTEGRITY, dispatching one of the OnSTUNRequest* handlers, or writing the response back to the socket. The exception is absorbed by the listener so the server keeps running; use this event to surface the failure to logs or monitoring. Inspect E.ClassName and E.Message for details; do not re-raise E. The handler runs on the listener thread unless NotifyEvents redirects it, so avoid direct UI access without proper synchronization.
procedure TForm1.OnSTUNException(Sender: TObject; E: Exception);
begin
Memo1.Lines.Add('STUN error: ' + E.ClassName + ' - ' + E.Message);
end;