Android 蓝牙socket非阻塞通信教程
我正在寻找 Android 上的蓝牙示例代码来进行非阻塞套接字通信。
我找到了几个例子,例如BluetoothChat或BluetoothSocket.java,但没有一个是非阻塞套接字通信。ps
非阻塞自动意味着必须是异步的吗?我认为实际上不是 - 它不一样,我假设我可以进行带有超时的同步套接字通信。这就是我正在寻找的例子......
非常感谢
I am looking for a bluetooth sample code on Android to do non-blocking socket communication.
I found several examples, like the BluetoothChat or BluetoothSocket.java but none is non-blocking socket communication.
ps does non-blocking automatically mean that is has to be asynchronous? I think actually not - it is not the same, I assume I could do synchronous socket communication with a timeout. That's the kind of example I am looking for...
Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来答案几乎是你不能
,但是通过一点线程魔法,你可以让你的系统按照你想要的方式工作
消息系统
套接字侦听器
Looks like the answer is pretty much you can't
however with a bit of threading magic, your can have your system work the way you want
message system
socket listener