TsgcWSPServer_WebRTCEvents › OnError

OnError Event

Fires when the server detects a transport or protocol-level error on a signalling connection.

Syntax

property OnError: TsgcWSErrorEvent;
// TsgcWSErrorEvent = procedure(Connection: TsgcWSConnection; const Error: string) of object

Default Value

Remarks

Surfaces transport-level failures (TLS negotiation, socket resets, abnormal close) and protocol-level anomalies raised by the signalling decoder against an incoming frame (malformed JSON, unexpected method id, bad subscription syntax). The Error string is a human-readable description intended for logging. Errors that come from inside user event handlers are reported separately through OnException.

Example


procedure TForm1.WebRTCServerError(Connection: TsgcWSConnection;
  const Error: string);
begin
  Memo1.Lines.Add(Format('[%s] error: %s', [Connection.Guid, Error]));
end;

Back to Events