GithubHelp home page GithubHelp logo

libinzhangyuan / reliable_udp_bench_mark Goto Github PK

View Code? Open in Web Editor NEW
102.0 102.0 20.0 364 KB

Test reliable udp for situation of realtime pvp game by wireless.

License: GNU General Public License v2.0

Shell 1.76% Makefile 34.43% C++ 63.81%

reliable_udp_bench_mark's People

Contributors

libinzhangyuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

reliable_udp_bench_mark's Issues

a socket bug

There is a socket bug in your client both dgram and stream. you should not bind the client socket with the client fd. for example:
// bind
sockaddr_in my_addr;
my_addr.sin_family = AF_INET;
my_addr.sin_port = htons(local_port_);
my_addr.sin_addr.s_addr = INADDR_ANY;
std::memset(&(my_addr.sin_zero), '\0', 8);
if (UDT::ERROR == UDT::bind(sock_, (sockaddr*)&my_addr, sizeof(my_addr)))
{
std::cout << "UDT bind: " << UDT::getlasterror().getErrorCode() << ' ' << UDT::getlasterror().getErrorMessage() << std::endl;
return -1;
}

The problem with the bug:
1.when you start the client first,
2.start the server.
3.your tester can not work.

The reason is that the new fd binding in the client covered the server's fd. and it maybe not appear which the client and server are on different machines. what's more, binding a address and using another address is not a correct way.

Not a good benchmark at all

You set ENet to 56k down per sec. thats kbits, not kbytes. thats only 7Kbytes ber second. And 14k up (14kbits, or 1.75 Kb). You then try to send 500 bytes per 50ms, which is 10,000 bytes. That doesn't leave enough for protocol messages without needless delay, especially with the upload set so low.

Also, UDT buffers data to send it in large packets using the do-not-fragment flag. The result is more latency and but much higher throughput. It was designed to send GB of data per second between satellites in a day that such speeds where unheard of. If not set right it will consume huge amounts of CPU. That's not a bug, just the result of UDT spinning in a tight loop between sending data. These gaps allow the buffer to fill in order to maximize throughput, rather than repeatedly calling send on individual packets.

Also, your running KCP using multiple threads, one example using pthreads and another via boost asio. They are not delayed as the ENet client was. Why you would use multiple undelayed clients vs one that is delayed is beyond confusing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.