TsgcTURNClientEvents › OnSTUNResponseSuccess

OnSTUNResponseSuccess Event

Fires when the server returns a success response to any STUN or TURN request.

Syntax

property OnSTUNResponseSuccess: TsgcSTUNResponseSuccessEvent;
// TsgcSTUNResponseSuccessEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message; const aBinding: TsgcSTUN_ResponseBinding) of object

Default Value

Remarks

Called whenever the server answers with a 2xx STUN response, including the success responses for Binding, Allocate, Refresh, CreatePermission and ChannelBind requests. The more specific OnTURN* events (OnTURNAllocate, OnTURNRefresh, etc.) fire in addition to this one. Read aBinding.RemoteIP and aBinding.RemotePort for the XOR-MAPPED-ADDRESS when the response was a Binding Response.

Example

procedure TForm1.oTURNSTUNResponseSuccess(Sender: TObject;
  const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
  const aBinding: TsgcSTUN_ResponseBinding);
begin
  DoLog('TURN success response, method: ' + IntToStr(Ord(aMessage.Method)));
end;

Back to Events