Testing the fuck band width
2013-12-31 23:06
316 查看
In my simple mind, it should be easy totest the band width, below is my simple steps
1) using socket to connect two devices
2) one device as server, the other one asthe client
3) before send packet, record the currentticks
4) one device send packet to another onecontinuesly
5) after send out the specified numberpackets, exit the loop
6) get the ticks
7) get the D-value between the twice ticks
8) get the size of data we total send out
9) here we get the result in MBPS
It looks fine, but it does not work verywell. My testing result is not invariable, and the max one is 3MBPS, but what Iwant is not less than 10MBPS.
Good good study, day day up. It should besome setting I miss in SOCKET.
I try to enable the TCP_NODELAY bysetsockopt, but the result is same
I try to set FD_SET by select, but theresult is same
I try to use unblock send by ioctlsocket,but the result is same, no, this time result is not same, but the send functionalways return fail.
Another info all the up testing baseonethe send buffer size is64KB(default), I think it should be enough.
By now, I have no idea, I will be exhaust,what I can do is only to change the send buffer size by setsockopt, that istry, only one time try, I have no any hope.
But this time, luckly kiss me one moretime, the result is around 10MBPS, currently send buffer size if 128KB. Peoplealways are greedy, what about the 256KB? This time I was disappointed, thefunction setsockopt return fail directly. It should not be surpported byWindows.
本文出自 “bluefish” 博客,请务必保留此出处http://bluefish.blog.51cto.com/214870/1347294
1) using socket to connect two devices
2) one device as server, the other one asthe client
3) before send packet, record the currentticks
4) one device send packet to another onecontinuesly
5) after send out the specified numberpackets, exit the loop
6) get the ticks
7) get the D-value between the twice ticks
8) get the size of data we total send out
9) here we get the result in MBPS
It looks fine, but it does not work verywell. My testing result is not invariable, and the max one is 3MBPS, but what Iwant is not less than 10MBPS.
Good good study, day day up. It should besome setting I miss in SOCKET.
I try to enable the TCP_NODELAY bysetsockopt, but the result is same
I try to set FD_SET by select, but theresult is same
I try to use unblock send by ioctlsocket,but the result is same, no, this time result is not same, but the send functionalways return fail.
Another info all the up testing baseonethe send buffer size is64KB(default), I think it should be enough.
By now, I have no idea, I will be exhaust,what I can do is only to change the send buffer size by setsockopt, that istry, only one time try, I have no any hope.
But this time, luckly kiss me one moretime, the result is around 10MBPS, currently send buffer size if 128KB. Peoplealways are greedy, what about the 256KB? This time I was disappointed, thefunction setsockopt return fail directly. It should not be surpported byWindows.
本文出自 “bluefish” 博客,请务必保留此出处http://bluefish.blog.51cto.com/214870/1347294
相关文章推荐
- 如何在C/C++中动态分配二维数组
- 如何使用真机调试Android应用
- Axis2用法(3)soap消息携带消息头
- sql分页查询语句
- A murder from a data abort exception
- 任何时候都适用的20个C++技巧
- Uni2D 入门 -- Asset Table
- 工作行业分类中英文对照
- Flex样式-HRule篇
- 马上2014
- C#事件和Unity3d
- 带你走进EJB--事务管理(2)
- php manual
- 企业级标准主机防火墙的手动部署
- WinCE7 starting architecture
- 程序猿找工作必练内功:排序算法大总结(五)——线性时间排序算法(计数排序,基数排序,桶排序)
- 2013年的总结
- OpenStack Cinder源码分析之四
- OpenStack Cinder源码分析之三
- Flex样式-TabNavigator篇