您的位置:首页 > 其它

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: