M
M
MrStuff882017-05-26 11:55:59
Android
MrStuff88, 2017-05-26 11:55:59

What is the correct implementation of the communication protocol?

Good afternoon. Please tell me how the communication protocol between the server and the Android application should be implemented correctly. It is required to transfer an array of bytes, for example, 100 kb. The server is able to transfer data about 2 KB in size. There are 2 options:
1) the application makes a request to the server (sends one command), and the server sends the entire array of bytes in batches of 2 to bytes in a row
2) the application makes a request to the server, which indicates the range of the required data or their size. The server sends one packet, then the amount of data requested by the application. Next, the application makes a request for the next range\number of data, etc.
UPDATE: Communication takes place over a Tcp / ip channel over a Wi-Fi network. The
server is a self-made device

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question