Android 蓝牙 - 可发现且同时有多个打开的连接?
几个月前,我用 C# 编写了一个消息程序,该程序使许多客户端能够连接到服务器并进行聊天。
现在,我想为 Android 编写相同的程序。阅读 Android 开发人员中的蓝牙文章后,似乎设备可以同时拥有许多蓝牙套接字+可被发现(我说的是服务器)。所说的唯一不应该与蓝牙套接字一起使用的操作是发现,但由于客户端运行该操作,因此它不会发生太大变化。
但让我不确定是否可以做到的是,Android 市场上没有这样的应用程序! (至少在快速检查后没有。)有很多蓝牙聊天应用程序,但没有一个允许多客户端。
因此,在开始编码之前,我想确保这是可能的,并确保持有 5 个 tcp 套接字不会杀死服务器电话。
提前致谢 :)
A few months ago I have coded a messenger program in C# which enables many clients to connect to a server and have a chat.
Now, I want to code the same program for android. After reading the bluetooth article in Android Developers, it seems that this is possible for a device to hold many bluetooth sockets at the same time + be discoverable (I'm talking about the server). The only action the said that should not work togather with bluetooth sockets is discovery, but since the client runs that, it doesn't change much.
But what made me unsure if it's possible to be done, is the fact that there is NO such an application in the android market! (Atleast not after a quick check.) There are many bluetooth chat apps, but none of them allows multi clients.
So before I begin coding that, I want to make sure it is possible, and make sure that holding, say, 5 tcp sockets won't kill the server phone.
Thanks in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我找到的一个链接:
“官方 Android 蓝牙聊天示例的多设备扩展”
这就是您想要的吗?
Here is a link I found:
"Multi-device extension of the official Android Bluetooth Chat example"
Is that what you wanted?