Today we comprehensively tested TCP , MQTT , and HTTP connections. TCP can establish up to 7 connections. We still use Anxin Transparent Cloud to test, MQTT connects to Alibaba Cloud, and HTTP connection time interface obtains time.
The video connects TCP , HTTP , and MQTT in sequence , and then sends and receives data, which feels very smooth.
However, the HTTP server of the time interface will force the connection to be disconnected after one minute. This is probably because the interface does not allow the client to occupy too much time and is forced to go offline. In addition, NO FIND CLIENT will appear when you connect for the second time .
Therefore, it is best to close the connection after sending each message, so as to free up memory and avoid hardware crashes and so on.
After testing, MQTT and TCP are still quite stable, but it is still recommended to close them if no messages are sent for too long.
In fact, the connection only requires a few instructions, which is very fast and can avoid some error handling caused by accidental disconnection.