TsgcSTUNClient › Events › OnSTUNBeforeSend
Fires just before a STUN message is sent to the server, allowing last-minute inspection or modification of the outgoing message.
property OnSTUNBeforeSend: TsgcSTUNBeforeSendEvent;
// TsgcSTUNBeforeSendEvent = procedure(Sender: TObject; const aMessage: TsgcSTUN_Message) of object
—
Called after the STUN message has been built but before it is serialized to the wire. Use aMessage to read the method, transaction id and attribute list, or to add/remove custom attributes. This is the ideal hook to add tracing or to enforce protocol-level policies.
procedure TForm1.oSTUNSTUNBeforeSend(Sender: TObject; const aMessage: TsgcSTUN_Message);
begin
DoLog('Sending STUN message, transaction id: ' + aMessage.TransactionID);
end;