TsgcSTUNClient › Eventi › OnSTUNResponseError
Si attiva quando il server STUN restituisce una risposta di errore; espone il codice numerico e il motivo leggibile dall'utente.
property OnSTUNResponseError: TsgcSTUNResponseErrorEvent;
// TsgcSTUNResponseErrorEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aError: TsgcSTUN_ResponseError) of object
—
Viene chiamato quando il server risponde a una Binding Request con una risposta di errore STUN (ad esempio 401 Unauthorized, 420 Unknown Attribute, 438 Stale Nonce). Leggere aError.Code e aError.Reason per diagnosticare l'errore, e aMessage per la risposta grezza. Gli errori relativi all'autenticazione di solito significano che STUNOptions.Authentication deve essere configurato prima di riprovare.
procedure TForm1.oSTUNSTUNResponseError(Sender: TObject;
const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
const aError: TsgcSTUN_ResponseError);
begin
DoLog('Error: ' + IntToStr(aError.Code) + ' ' + aError.Reason);
end;