Limit the bandwidth while downloading

后端 未结 2 667
一个人的身影
一个人的身影 2021-01-20 04:17

I have an app that can use internet connection to downloading data. I\'m using HttpURLConnection to do that.

Problem: My app drains the

2条回答
  •  Happy的楠姐
    2021-01-20 04:32

    If you had a Socket you could just set the receive buffer size to the desired bandwidth-delay product, but, as you don't, you will just have to sleep between receive calls. Experiment or some feedback-based arithmetic will yield the appropriate sleep intervals.

提交回复
热议问题