TsgcSTUNClientイベント › OnSTUNResponseError

OnSTUNResponseError イベント

STUN サーバーがエラーレスポンスを返したときに発生します。数値コードと人間が読める理由を公開します。

構文

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

デフォルト値

解説

サーバーがバインディングリクエストに STUN エラーレスポンス(例:401 Unauthorized、420 Unknown Attribute、438 Stale Nonce)で応答したときに呼び出されます。障害を診断するには aError.CodeaError.Reason を読み取り、生のレスポンスは aMessage で確認してください。認証関連のエラーは通常、再試行前に STUNOptions.Authentication を設定する必要があることを意味します。

使用例

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;

イベントに戻る