最快的服务器客户端通信?

Fastest server client communication?

我想制作一个非常快速的 android 应用程序来与 ubuntu 上的家庭服务器 运行 通信。

所以我用 json flask、TCP 套接字和 UDP 套接字做了一些东西。

我想要有关我的网络、温度读数、日志事件、我制作的设备、我的 LED 灯条以及未来更多信息。

问题是我希望 LED 灯条的响应尽可能快。 而且还能得到其他信息。

所以感觉很有反应。同样在未来,我想用我的 phone 的 x、y 和 z 传感器实现一些东西。这也必须非常敏感。

任何人都可以帮助我了解哪种技术或其他技术适合这种关闭应用程序。

提前致谢

我们在无人驾驶地铁项目中使用了UDP连接。它非常快但不可靠。所以你需要用它来编写交叉检查语句。

My advice and answer is;
You can use UDP and also create a header for checking process. For example 2 Byte header for network checking. We did this in the Big Driverless metro project.
You should send the data each time when the receiver catch the data.

Sample;

[ 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 ] <-- 1 Byte, 8 Bit 

0 --> Did receiver catch the data ? 
1 --> If receiver catch data, make this bit 1 and resend to the sender.
2 --> Receiver to Sender
3 --> 
8 --> Backup

You need to create a header byte data, and put your checking statements in it.

如何发送温度

如果您使用 UDP 或 TCP,我们可以发送 ONU BYTE 作为最小数据。即我们不能发送 Bit。 1 字节 = 8 位

发件人到收件人 1.字节[ 0 位 --> 获取温度信息 1 位 -->
2.字节[免费]

每秒发送一次并监听接收者也许它发送了我们不再需要请求的信息。检查 Receiver'first byte'的第一位。 如果它的 0 继续发送 如果它的 1 ohh 接收器发送温度信息看第二个字节它的温度

收件人到发件人 收听发件人,如果发件人发送数据,则检查第一个字节的第一个位,如果它的 0 不在乎。如果是 1 发送方向我们请求温度信息。将温度信息发送给发送者。 make first byte' first bit 1. make second byte temperature information.

1.Byte [0.bit 零或一] 2.Byte [温度信息]