Git Product home page Git Product logo

wlanoptimizer's Introduction

WLANOptimizer

Single-header C library that fixes WiFi performance issues for online gaming and other low-latency real-time network traffic.

This fixes a common issue on Windows laptops where the adapter scans for networks while a connection is active, causing 100+ millisecond delays. This makes a huge difference in performance for real-time multiplayer!

On my laptop it reduces the latency from 130 ms delay spikes to 10 ms or less - 10x improvement.

Notably this also improves my BitTorrent download speed by 4x, as BitTorrent protocol uses a congestion control strategy based on latency (LEDBAT). These latency spikes cause download speed to plummet in easy, repeatable tests.

Note: This settings change DOES NOT require Administrator access.

Easy setup:

    Add the include header somewhere:

        #include "WLANOptimizer.h"

    Call the start function:

        StartWLANOptimizerThread();

And that's it.

Demo

To try it out quickly, run the tests/stand_alone.exe application.

To set up a more thorough demo between two computers on your LAN, run the tests/tests_peer2peer_gui.exe on two computers on your WiFi LAN.

The results on my WLAN:

demo.png

Credits

Software by Christopher A. Taylor [email protected]

Please reach out if you need support or would like to collaborate on a project.

wlanoptimizer's People

Contributors

catid avatar qwertychouskie avatar skibz 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  avatar  avatar  avatar

Watchers

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

wlanoptimizer's Issues

Provide stand-alone binary

Is there any chance of providing a stand-alone binary version? This could be a really nice thing to run at startup on some systems.

Compilation errors with MinGW

$ x86_64-w64-mingw32-g++ --static wifibetter.cpp WLANOptimizer.h WLANOptimizer.cpp -o wifilagkill.exe -std=c++1y
WLANOptimizer.cpp:37:13: error: ‘mutex’ in namespace ‘std’ does not name a type
 static std::mutex APILock;
             ^~~~~
WLANOptimizer.cpp: In function ‘int OptimizeWLAN(int)’:
WLANOptimizer.cpp:133:26: error: ‘mutex’ is not a member of ‘std’
     std::lock_guard<std::mutex> locker(APILock);
                          ^~~~~
WLANOptimizer.cpp:133:26: error: ‘mutex’ is not a member of ‘std’
WLANOptimizer.cpp:133:31: error: template argument 1 is invalid
     std::lock_guard<std::mutex> locker(APILock);
                               ^
WLANOptimizer.cpp:133:40: error: ‘APILock’ was not declared in this scope
     std::lock_guard<std::mutex> locker(APILock);
                                        ^~~~~~~
WLANOptimizer.cpp:133:40: note: suggested alternative: ‘HeapLock’
     std::lock_guard<std::mutex> locker(APILock);
                                        ^~~~~~~
                                        HeapLock
WLANOptimizer.cpp: At global scope:
WLANOptimizer.cpp:231:18: error: ‘mutex’ in namespace ‘std’ does not name a type
     mutable std::mutex StartStopLock;
                  ^~~~~
WLANOptimizer.cpp:234:18: error: ‘mutex’ in namespace ‘std’ does not name a type
     mutable std::mutex WakeLock;
                  ^~~~~
WLANOptimizer.cpp:237:10: error: ‘condition_variable’ in namespace ‘std’ does not name a type
     std::condition_variable WakeCondition;
          ^~~~~~~~~~~~~~~~~~
WLANOptimizer.cpp:240:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
     std::shared_ptr<std::thread> Thread;
          ^~~~~~~~~~
WLANOptimizer.cpp: In member function ‘void WLANOptimizerThread::Start()’:
WLANOptimizer.cpp:252:26: error: ‘mutex’ is not a member of ‘std’
     std::lock_guard<std::mutex> startStopLocker(StartStopLock);
                          ^~~~~
WLANOptimizer.cpp:252:26: error: ‘mutex’ is not a member of ‘std’
WLANOptimizer.cpp:252:31: error: template argument 1 is invalid
     std::lock_guard<std::mutex> startStopLocker(StartStopLock);
                               ^
WLANOptimizer.cpp:252:49: error: ‘StartStopLock’ was not declared in this scope
     std::lock_guard<std::mutex> startStopLocker(StartStopLock);
                                                 ^~~~~~~~~~~~~
WLANOptimizer.cpp:252:49: note: suggested alternative: ‘startStopLocker’
     std::lock_guard<std::mutex> startStopLocker(StartStopLock);
                                                 ^~~~~~~~~~~~~
                                                 startStopLocker
WLANOptimizer.cpp:254:10: error: ‘Thread’ was not declared in this scope
     if (!Thread)
          ^~~~~~
WLANOptimizer.cpp:254:10: note: suggested alternative: ‘_hread’
     if (!Thread)
          ^~~~~~
          _hread
WLANOptimizer.cpp:257:23: error: ‘make_shared’ is not a member of ‘std’
         Thread = std::make_shared<std::thread>(&WLANOptimizerThread::Loop, this);
                       ^~~~~~~~~~~
WLANOptimizer.cpp:257:23: note: suggested alternative: ‘make_signed’
         Thread = std::make_shared<std::thread>(&WLANOptimizerThread::Loop, this);
                       ^~~~~~~~~~~
                       make_signed
WLANOptimizer.cpp:257:40: error: ‘thread’ is not a member of ‘std’
         Thread = std::make_shared<std::thread>(&WLANOptimizerThread::Loop, this);
                                        ^~~~~~
WLANOptimizer.cpp:257:40: note: suggested alternative: ‘tera’
         Thread = std::make_shared<std::thread>(&WLANOptimizerThread::Loop, this);
                                        ^~~~~~
                                        tera
WLANOptimizer.cpp: In member function ‘void WLANOptimizerThread::Stop()’:
WLANOptimizer.cpp:263:26: error: ‘mutex’ is not a member of ‘std’
     std::lock_guard<std::mutex> startStopLocker(StartStopLock);
                          ^~~~~
WLANOptimizer.cpp:263:26: error: ‘mutex’ is not a member of ‘std’
WLANOptimizer.cpp:263:31: error: template argument 1 is invalid
     std::lock_guard<std::mutex> startStopLocker(StartStopLock);
                               ^
WLANOptimizer.cpp:263:49: error: ‘StartStopLock’ was not declared in this scope
     std::lock_guard<std::mutex> startStopLocker(StartStopLock);
                                                 ^~~~~~~~~~~~~
WLANOptimizer.cpp:263:49: note: suggested alternative: ‘startStopLocker’
     std::lock_guard<std::mutex> startStopLocker(StartStopLock);
                                                 ^~~~~~~~~~~~~
                                                 startStopLocker
WLANOptimizer.cpp:265:9: error: ‘Thread’ was not declared in this scope
     if (Thread)
         ^~~~~~
WLANOptimizer.cpp:265:9: note: suggested alternative: ‘_hread’
     if (Thread)
         ^~~~~~
         _hread
WLANOptimizer.cpp:271:35: error: ‘mutex’ is not a member of ‘std’
             std::unique_lock<std::mutex> wakeLocker(WakeLock);
                                   ^~~~~
WLANOptimizer.cpp:271:35: error: ‘mutex’ is not a member of ‘std’
WLANOptimizer.cpp:271:40: error: template argument 1 is invalid
             std::unique_lock<std::mutex> wakeLocker(WakeLock);
                                        ^
WLANOptimizer.cpp:271:53: error: ‘WakeLock’ was not declared in this scope
             std::unique_lock<std::mutex> wakeLocker(WakeLock);
                                                     ^~~~~~~~
WLANOptimizer.cpp:271:53: note: suggested alternative: ‘wakeLocker’
             std::unique_lock<std::mutex> wakeLocker(WakeLock);
                                                     ^~~~~~~~
                                                     wakeLocker
WLANOptimizer.cpp:272:13: error: ‘WakeCondition’ was not declared in this scope
             WakeCondition.notify_all();
             ^~~~~~~~~~~~~
WLANOptimizer.cpp:284:5: error: ‘Thread’ was not declared in this scope
     Thread = nullptr;
     ^~~~~~
WLANOptimizer.cpp:284:5: note: suggested alternative: ‘_hread’
     Thread = nullptr;
     ^~~~~~
     _hread
WLANOptimizer.cpp: In member function ‘void WLANOptimizerThread::Loop()’:
WLANOptimizer.cpp:302:31: error: ‘mutex’ is not a member of ‘std’
         std::unique_lock<std::mutex> locker(WakeLock);
                               ^~~~~
WLANOptimizer.cpp:302:31: error: ‘mutex’ is not a member of ‘std’
WLANOptimizer.cpp:302:36: error: template argument 1 is invalid
         std::unique_lock<std::mutex> locker(WakeLock);
                                    ^
WLANOptimizer.cpp:302:45: error: ‘WakeLock’ was not declared in this scope
         std::unique_lock<std::mutex> locker(WakeLock);
                                             ^~~~~~~~
WLANOptimizer.cpp:302:45: note: suggested alternative: ‘HeapLock’
         std::unique_lock<std::mutex> locker(WakeLock);
                                             ^~~~~~~~
                                             HeapLock
WLANOptimizer.cpp:305:13: error: ‘WakeCondition’ was not declared in this scope
             WakeCondition.wait_for(locker, kOptimizeInterval);
             ^~~~~~~~~~~~~

Contents of wifibetter.cpp:

#include "WLANOptimizer.h"
#include <cstdlib>

using namespace std;

int main() 
{
    StartWLANOptimizerThread();
    system("pause");
    return 0;
}

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.