TsgcTURNClient › Events › OnSTUNResponseError
Fires when the server returns an error response (for example 401 Unauthorized or 437 Allocation Mismatch).
property OnSTUNResponseError: TsgcSTUNResponseErrorEvent;
// TsgcSTUNResponseErrorEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aError: TsgcSTUN_ResponseError) of object
—
Called when the server answers any STUN or TURN request with an error response. Read aError.Code and aError.Reason to diagnose the failure. Typical TURN error codes include 401 Unauthorized (credentials missing - RFC 5766 signs a retry automatically after the initial challenge), 437 Allocation Mismatch (transaction id reused or allocation not found), 438 Stale Nonce, 441 Wrong Credentials and 486 Allocation Quota Reached.
procedure TForm1.oTURNSTUNResponseError(Sender: TObject;
const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
const aError: TsgcSTUN_ResponseError);
begin
DoLog('Error: ' + IntToStr(aError.Code) + ' ' + aError.Reason);
end;