TsgcSTUNClientEventi › OnSTUNResponseSuccess

OnSTUNResponseSuccess Evento

Si attiva quando il server STUN restituisce una risposta di binding positiva con l'indirizzo mappato del client.

Sintassi

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

Valore predefinito

Note

Chiamato quando il server risponde a una Binding Request con una risposta STUN 2xx. aBinding.RemoteIP e aBinding.RemotePort contengono l'indirizzo riflessivo (mappato dal NAT) scoperto dal server; aMessage dà accesso alla risposta completa, inclusi eventuali attributi extra restituiti.

Esempio

procedure TForm1.oSTUNSTUNResponseSuccess(Sender: TObject;
  const aSocket: TsgcSocketConnection; const aMessage: TsgcSTUN_Message;
  const aBinding: TsgcSTUN_ResponseBinding);
begin
  DoLog('Remote IP: ' + aBinding.RemoteIP +
        '. Remote Port: ' + IntToStr(aBinding.RemotePort));
end;

Torna agli Eventi