TsgcSTUNClientEvents › OnSTUNResponseError

OnSTUNResponseError Event

STUN 서버가 오류 응답을 반환할 때 발생합니다. 숫자 Code와 사람이 읽을 수 있는 Reason을 노출합니다.

구문

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)으로 Binding Request에 응답할 때 호출됩니다. 실패를 진단하려면 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;

이벤트로 돌아가기