wxWidgets 套接字传输速率
计算 wxWidgets 套接字传输速率的最佳方法是什么?是否有内置的方法可以做到这一点,或者我是否可以更好地获取数据传输之前和数据传输完成后的时间并进行比较?
我问这个问题是因为我希望能够将套接字的传输速率限制为用户输入的值。
感谢您的帮助
What is the best way to figure out the transfer rate of a wxWidgets socket. Is there a built in way to do this, or would I be better getting the time before a transfer of data and then after its done and comparing them?
I ask because I want to be able to limit the transfer rate of my sockets to a user entered value.
Thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,wxWidgets 中似乎没有内置任何机制来测量套接字传输速率 * 。您能做的最好的事情就是测量调用
wxSocketBase 的速率: :写
。但请注意,这并不完全准确。仅仅因为您写入套接字并不意味着数据已经发送,更不用说已经接收了。
No, there does not appear to be any mechanism built into wxWidgets to measure socket transfer rate *. The best you can do is to measure the rate at which you call
wxSocketBase::Write
.Note that this won't be perfectly accurate, however. Just because you write to a socket doesn't mean that the data is already sent, much less already received.