If the data is characterized by some latency in generating it, this could easily result in the peer receiving the whole data earlier than if it was necessary to build up an entire file first, (to accurately determine the length), before any transmission at all can start. This usually means a byte-by-byte state-machine:(Īn upside is that you can start sending the data as soon as first bit of it is available. The downside that you have to go through evey tx byte to insert the sequences as needed and to examine every char that is received. Use a different protocol on top of TCP that does not need sending the length, eg. But its reading the flag along with the data. At the Server's output the 6th read size should have been 15. After that, a flag ("done") is sent (which i am not counting). ![]() Th sent_size 20 3 th sent_size 20 4 th sent_size 20 5 th sent_sizeĢ0 6 th sent_size 8 6 th read.read_size is not 20 and it is 8Īs seen in the Client's output the 6th read from the file is only 15 bytes,so the client is sending 15 bytes. ![]() Read_size is not 20 and it is 15 First file sent 1 th sent_size 20 2 Sent_size 20 5 th sent_size 20 6 th sent_size 15 6th read. read size is:5, Data read : done Flagġ th sent_size 20 2 th sent_size 20 3 th sent_size 20 4 th read size is:8, Dataġ3 th Read size 5 13 th read. Th Read size 20 12 th Read size 8 12 th read. Size 20 8 th Read size 20 9 th Read size 20 10 th Read size 20 11 Server Waiting 1 th Read size 20 2 th Read size 20 3 th Read size 20Ĥ th Read size 20 5 th Read size 20 6 th Read size 20 7 th Read read size is:%d, Data read : ",i,read_size ) įor(j=0 j
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |