跟踪在线/离线节点 [英] Keeping track of online/offline nodes

查看:54
本文介绍了跟踪在线/离线节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在开发UWP C#中的一对一视频通话。它目前工作正常。

I am developing some kind of one to one video call in UWP C#. It works fine for the moment.


我要做的是所有节点都有实时(几乎)知道其他节点的可用性节点。换句话说,每个节点必须知道哪些节点在线,哪些节点不在线。

有点喜欢在聊天中你看看谁在线,谁不在线。 
我也可以拥有一个服务器,所有节点都可以连接,但最好不要用它来完成这项任务。

What I am trying to do is that all the nodes have real-time (almost) knowledge of the availability of the other nodes. In other words, each node has to know which nodes are online and which are not. Kind of like in a chat where you see who is online and who is not. I can also have a server that all the nodes can connect to but preferably not use it for this task.


我想在节点每隔几秒钟上线时发信号通知服务器,如果节点在一段时间内没有发出信号(超时),则认为它处于脱机状态。并且服务器通知所有节点。但我更喜欢没有这种超时的解决方案。我不想
想要充斥服务器,并处理这样的超时。

I thought of signaling the server when a node goes online each few seconds, and if a node doesnt signal the server in a while (timeout) it is considered offline. And the server notifies all the nodes. But i would prefer a solution without such timeouts. I dont want to flood the server, and handle such timeouts.


也许我可以获得一些事件onBeforeDisconnect和onBeforeClose,它们可以向服务器发出信号他们正在断开连接。但这只是在没有服务器的情况下无法完成。

Perhaps i could get some event onBeforeDisconnect and onBeforeClose that could signal the server that they are disconnecting right before they do. But this is only in case it cannot be done without the server.


如何在UWP中存档此任务?值得指出的是,该应用程序将在VLAN上运行。

How can i archive this task in UWP? It could be worth to point out that the app will work on a VLAN.

推荐答案

您好,

那么,您需要通知每个其他客户当前节点的状态吗?我认为使用服务更好。如果您没有服务器,则需要向所有其他节点发送请求。另一个问题是,你怎么知道你当前节点之外的节点多少

Well, so you need to inform every other client about the currently node's status right? I think that using a service is a better. If you don't have a server, you will need to send request to all the other nodes. Another question is that how do you know how much nodes outside your current node?

所以也许服务器使用起来更方便。

So maybe the server is more convenient to use.

祝你好运,

Roy


这篇关于跟踪在线/离线节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆