Is there an optimal byte size for sending data over a network?

后端 未结 9 2086
既然无缘
既然无缘 2021-02-19 15:25

I assume 100 bytes is too small and can slow down larger file transfers with all of the writes, but something like 1MB seems like it may be too much. Does anyone have any sugge

9条回答
  •  独厮守ぢ
    2021-02-19 16:13

    Here is the formula you need:

    int optimalChunkSize = totalDataSize / progressBar1.Width;
    

    Using this, each chunk you send will increment the progress bar by 1 pixel. A smaller chunk size than this is pointless, in terms of user feedback.

提交回复
热议问题