TsgcTURNServer이벤트 › OnSTUNRequestError

OnSTUNRequestError 이벤트

서버가 STUN/TURN 오류 응답을 보내기 전에 발생하며, 핸들러가 응답을 검사하거나 억제할 수 있도록 합니다.

구문

property OnSTUNRequestError: TsgcSTUNRequestErrorEvent;
// TsgcSTUNRequestErrorEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aRequest: TsgcSTUN_Message; const aResponse: TsgcSTUN_Message; var Accept: Boolean) of object

기본값

설명

서버가 오류 응답(예: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 437 Allocation Mismatch, 438 Stale Nonce, 441 Wrong Credentials, 442 Unsupported Transport Protocol, 486 Allocation Quota Reached, 508 Insufficient Capacity)을 빌드하고 이를 클라이언트에 다시 보내려고 할 때 발생합니다. 실패 사유를 기록하려면 aRequest / aResponse, 특히 aResponse의 ERROR-CODE 속성을 검사하십시오. 데이터그램을 삭제하고 클라이언트에 응답을 남기지 않으려면 Accept := False로 설정하십시오. 이는 동일한 소스에서 반복되는 잘못된 요청이 도착할 때 증폭을 피하는 데 유용할 수 있습니다. 핸들러는 NotifyEvents가 다른 모드를 선택하지 않는 한 리스너 스레드에서 실행됩니다.

예제

procedure TForm1.OnSTUNRequestError(Sender: TObject;
  const aSocket: TsgcSocketConnection; const aRequest: TsgcSTUN_Message;
  const aResponse: TsgcSTUN_Message; var Accept: Boolean);
begin
  Memo1.Lines.Add('TURN error for ' + aSocket.PeerIP);
  Accept := True;
end;

이벤트로 돌아가기