I am creating a C # application using the server-client model where the server sends an image (100kb) to the client via the socket every 50 ms ...
I used TCP, but besides the overhead of this protocol, sometimes the client received more than one image in the socket. And I don't yet have a smart mechanism for splitting the bytes of each image (in fact, I just need the very last one).
I tried using UDP, but came to the conclusion that I can not send 100kb dgrams, only 64kb. And even so, I should not use more than 1500 bytes; otherwise, the packet will be divided over the network, and the probability of losing part of the packet will be greater.
So now I'm a little confused. Should I continue to use TCP and put some escape bytes at the end of each image so that the client can separate them? Or should I use UDP, send dgrams of 1,500 bytes and come up with a mechanism for ordering and recovery?
The main goal here is to transfer images very quickly. I do not mind losing some along the way while the customer continues to receive new ones.
Or should I use a different protocol? Thanks in advance!
Joao oliveira
source
share