TsgcTURNServerOlaylar › OnTURNCreateAllocation

OnTURNCreateAllocation Olay

Bir istemci için yeni bir Allocation başarıyla oluşturulduktan sonra tetiklenir.

Sözdizimi

property OnTURNCreateAllocation: TsgcTURNAllocationEvent;
// TsgcTURNAllocationEvent = procedure(Sender: TObject; const aSocket: TsgcSocketConnection; const Allocation: TsgcTURNAllocationItem) of object

Varsayılan Değer

Remarks

Her başarılı ALLOCATE için bir kez, Allocation sunucunun dahili tablosuna eklendikten ve AllocateResponse istemciye dağıtıldıktan hemen sonra tetiklenir. Allocation tam bağlamı sunar: LocalIP/LocalPort (sunucu tarafı dinleme uç noktası), ReflexiveIP/ReflexivePort (istemcinin eşlenmiş adresi), RelayIP/RelayPort (istemciye XOR-RELAYED-ADDRESS aracılığıyla duyurulan geçiş aktarım adresi), Username/Realm, Lifetime / Expiry ve Permissions / Channels alt koleksiyonları. Bunu operasyonel panoları, muhasebeyi veya kullanıcı başına kotaları güncellemek için kullanın. Allocation örneği sunucuya aittir — onu serbest bırakmayın; ayırma süresi dolduğunda OnTURNDeleteAllocation olayına yeniden geçirilir. NotifyEvents yönlendirmediği sürece dinleyici iş parçacığında çalışır.

Örnek

procedure TForm1.OnTURNCreateAllocation(Sender: TObject;
  const aSocket: TsgcSocketConnection; const Allocation: TsgcTURNAllocationItem);
begin
  Memo1.Lines.Add(Format('Allocation created: user=%s relay=%s:%d lifetime=%d',
    [Allocation.Username, Allocation.RelayIP, Allocation.RelayPort,
     Allocation.Lifetime]));
end;

Olaylara Dön