TsgcSTUNClientEvents › OnSTUNResponseError

OnSTUNResponseError Evento

Disparado quando o servidor STUN retorna uma resposta de erro; expõe o Code numérico e o Reason legível por humanos.

Sintaxe

property OnSTUNResponseError: TsgcSTUNResponseErrorEvent;
// TsgcSTUNResponseErrorEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aError: TsgcSTUN_ResponseError) of object

Valor Padrão

Observações

Chamado quando o servidor responde a uma Binding Request com uma resposta de erro STUN (por exemplo, 401 Unauthorized, 420 Unknown Attribute, 438 Stale Nonce). Leia aError.Code e aError.Reason para diagnosticar a falha, e aMessage para a resposta bruta. Erros relacionados à autenticação normalmente significam que STUNOptions.Authentication deve ser configurado antes de tentar novamente.

Exemplo

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;

Voltar para Eventos