Skip to content

jakubtomsu/nettest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetTest

A small layer on top of Berkley sockets to simulate packet loss, delay, reodering and duplication to debug custom networking protocols.

Currently only supports Windows

Usage

This is a STB-style single-header library, so you can just paste nettest.h directly into your project.

In exactly one C/C++ file define NETTEST_IMPLEMENTATION before including:

#define NETTEST_IMPLEMENTATION 1
#include "nettest.h"

void main() {
    nettest_init(0); // init in async/threaded mode
    nettest_sendto(...); // instead of regular sendto
    nettest_shutdown();
}

Demo

Build with x64 Native Tools Command Prompt for VS using cl nettest_demo.cpp

img

About

Single header C lib to simulate packet loss, delay, reodering and duplication to debug custom networking protocols

Topics

Resources

Stars

Watchers

Forks

Contributors