开发者

How to Identify Bandwidth rate of TCP Client

I'm sending bulk data to client开发者_StackOverflow from my C# server application. Different clients may have different amounts of bandwidth available. For example, some clients may be using dial-up, broadband, etc.

A low-bandwidth client will be unable to get my data quickly, which may cause blocking in my server application.

I'm retrying the send 5 times to clients, if the data is not successfully received. I need to restrict data send by my server by tracking the bandwidth rate of clients.

How can I determine the bandwidth rate of receiving client in C# ?


That's not a very good approach, since bandwidth to any particular client can change dramatically.

Instead, implement some flow control (TCP provides this for you). Probably the only thing you need to do is configure your socket for non-blocking I/O, so it gives an error message when the transmit window fills instead of blocking your thread.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜