TsgcSTUNServer › 属性 › Active
启动或停止 STUN 服务器;设为 True 开始监听绑定请求。
property Active: Boolean read GetActive write SetActive;
—
将 Active 设置为 True,在 Host/Port 上打开 UDP 套接字,并开始处理传入的 STUN 绑定请求。将其设置为 False 可停止服务器,关闭所有绑定并释放监听线程。在激活之前配置 Port、STUNOptions 和任何 AddBinding 条目;影响套接字布局的更改需要重启服务器才能生效。
oSTUN := TsgcSTUNServer.Create(nil);
oSTUN.Port := 3478;
oSTUN.Active := True;