如何断开订阅流与网络流发布者的连接?
我有一个使用 stratus p2p 发布 netstream 的发布者。然后由订阅网络流的玩家连接到该网络。
我相信当流尝试使用 netstream 客户端的 onPeerConnect 方法进行连接时,可以拒绝订阅者。但是,我想在连接后启动订阅者。
该网络流可能还有其他订阅者,所以我不能直接关闭它。如何在不关闭已发布的网络流的情况下启动特定订户?
I have a publisher who publishes a netstream using stratus p2p. This is then connected to by player who subscribes to the netstream.
I believe one can reject the subscriber when the stream tries to connect by using the onPeerConnect method of the netstream's client. However, I would like to boot the subscriber after they have been connected.
There are potentially other subscribers to that netstream so I cannot just close it. How would I boot a particular subscriber without closing the published netstream?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发布NetStream 的peerStreams 属性是所有订阅者的NetStraem 数组。您可以迭代它并执行类似
netStream.peerStreams[0].close();
的操作The peerStreams property of your publishing NetStream is an array of NetStraems of all subscribers. You can iterate through it and do something like
netStream.peerStreams[0].close();