TsgcTURNServer › プロパティ › Active
TURNサーバーを開始または停止します。Trueに設定すると、ALLOCATE、Binding、およびリレー要求の受け付けを開始します。
property Active: Boolean read GetActive write SetActive;
—
Active を True に設定すると、Host/Port で UDP ソケットを開き、割り当て有効期限タイマーを開始し、STUN バインディングリクエストと TURN メソッド(ALLOCATE、REFRESH、CREATE-PERMISSION、CHANNEL-BIND、SEND/DATA インディケーションおよび ChannelData)のサービスを開始します。アクティベーション前に Port、STUNOptions、TURNOptions、および追加の AddBinding エントリを設定してください。Active を False に設定すると、すべてのリスナーが閉じられ、すべてのアクティブな割り当てが期限切れになり(OnTURNDeleteAllocation が発生)、リレーポートがプールに返されます。
oTURN := TsgcTURNServer.Create(nil);
oTURN.Port := 3478;
oTURN.TURNOptions.Authentication.Enabled := True;
oTURN.TURNOptions.Authentication.LongTermCredentials.Enabled := True;
oTURN.TURNOptions.Authentication.LongTermCredentials.Realm := 'esegece.com';
oTURN.Active := True;