TsgcSTUNClient › イベント › 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.Code と aError.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;