简体   繁体   English

在C#服务器上管理连接的Android客户端

[英]Manage connected android clients on C# server

I have Android clients connecting to a secure C# server. 我有Android客户端连接到安全的C#服务器。 I can send and receive data to and from both. 我可以向两者发送和接收数据。

What I would like to be able to do is keep track of each android client. 我希望能够做的是跟踪每个Android客户端。 I'm doing this via MAC address for now, but later I will have a unique ID that is more permanent. 我现在通过MAC地址执行此操作,但稍后我将拥有一个更加永久的唯一ID。

I am successfully sending the MAC address and receiving it, but I would like any ideas on how I can store the MAC address to later send specific messages to that device to which it belongs. 我正在成功发送MAC地址并接收它,但我想知道如何存储MAC地址以便稍后将特定消息发送到它所属的设备。

Right now I'm store the MAC addresses in a list but I'm not sure is the best way. 现在我将MAC地址存储在列表中,但我不确定是最好的方法。

I have done something similar and I just keep track of their addresses with a database and I use a stored procedure to keep track if they are connected..if they disconnect and then reconnect then I set it to closed in the database and don't allow the same address to be connected twice. 我做了类似的事情,我只是用数据库跟踪他们的地址,我使用存储过程跟踪他们是否连接..如果他们断开然后重新连接然后我在数据库中将其设置为关闭而不是允许相同的地址连接两次。 .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM