TsgcTURNClientMethods › SendRequest

SendRequest Method

Inherited generic STUN request used to send a Binding Request over the TURN transport.

Syntax

function SendRequest: Boolean;

Return Value

True when the request was successfully handed off to the transport for sending; False if the socket could not be opened. (Boolean)

Remarks

Inherited from TsgcSTUNClient. Sends a plain STUN Binding Request (RFC 5389) to the configured Host using the same socket that carries TURN traffic. This is useful when the TURN server also doubles as a STUN server (common with coturn) and the application wants to discover its reflexive transport address without opening a second connection.

The response surfaces through the standard OnSTUNResponseSuccess or OnSTUNResponseError events.

Example

if oTURN.SendRequest then
  DoLog('STUN Binding Request sent on TURN transport');

Back to Methods