TsgcTURNServerProperties › Active

Active 属性

启动或停止 TURN 服务器;设置为 True 以开始接受 ALLOCATE、Binding 和中继请求。

语法

property Active: Boolean read GetActive write SetActive;

默认值

备注

将 Active 设为 True,在 Host/Port 上打开 UDP 套接字,启动分配过期计时器,并开始响应 STUN Binding Requests 及 TURN 方法(ALLOCATE、REFRESH、CREATE-PERMISSION、CHANNEL-BIND、SEND/DATA 指示和 ChannelData)。激活前请先配置 PortSTUNOptionsTURNOptions 及任何额外的 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;

返回属性