TsgcSTUNClientEventos › OnSTUNResponseError

OnSTUNResponseError Evento

Se genera cuando el servidor STUN devuelve una respuesta de error; expone el código numérico y la razón legible por humanos.

Sintaxis

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

Valor Predeterminado

Observaciones

Se llama cuando el servidor responde a una solicitud de Binding con una respuesta de error STUN (por ejemplo, 401 Unauthorized, 420 Unknown Attribute, 438 Stale Nonce). Lea aError.Code y aError.Reason para diagnosticar el fallo, y aMessage para la respuesta sin procesar. Los errores relacionados con la autenticación generalmente significan que STUNOptions.Authentication debe configurarse antes de volver a intentarlo.

Ejemplo

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;

Volver a Eventos