How to send statistics? Using a socket or UDP packets?

Transmitted through the GSM module. The device is not planned to move - to stand still. It is planned to be transmitted every 5 seconds is not more than 1KB. Critically what would be the periodicity remained.
July 2nd 19 at 17:25
2 answers
July 2nd 19 at 17:27
UDP is also "socket", you choose between TCP and UDP better than TCP, but the frequency and packet delivery intact if there are problems with the network (turn off after the start of send or speed too low), it does not guarantee that you have to realize that was a check-sum and it was checked, if the receiving party perezapisyvalis package (and the package "portapros" also with a check-sum and so on to infinity until the whole package), about the size of the buffer make sure if it's different then implement the border for example by sending the first bytes of the packet size, in bytes, still need to login, because at any moment the server can connect to any bot and ruin it trying to send an HTTP request for example.
July 2nd 19 at 17:29
Frequency nobody will be able to guarantee, because:
1. In the case of using UDP-the packet can just get lost on the way.
2. In the case of using TCP, if a packet is lost, the TCP stack will detect this and ask you to send it again, another issue is that to detect it it can not after 5 or 10 seconds, but much later. Thus, the periodicity will be violated.
Yes, you would probably want to save the data locally and send the parts - loyce.Collier commented on July 2nd 19 at 17:32

Find more questions by tags ArduinoComputer networks