TsgcSTUNServer属性 › Active

Active 属性

启动或停止 STUN 服务器;设为 True 开始监听绑定请求。

语法

property Active: Boolean read GetActive write SetActive;

默认值

备注

将 Active 设置为 True,在 Host/Port 上打开 UDP 套接字,并开始处理传入的 STUN 绑定请求。将其设置为 False 可停止服务器,关闭所有绑定并释放监听线程。在激活之前配置 PortSTUNOptions 和任何 AddBinding 条目;影响套接字布局的更改需要重启服务器才能生效。

示例

oSTUN := TsgcSTUNServer.Create(nil);
oSTUN.Port := 3478;
oSTUN.Active := True;

返回属性