Skip to content

IlyaBizyaev/os-net-multiplexing

 
 

Repository files navigation

Basic SNTP-like client and server with multiplexing

Goal

This is an educational project, aimed at understanding how to interact with platform-specific multiplexing APIs (epoll, kqueue) to implement a more performant client-server architecture.

Features:

  • A client that requests timestamp seconds
  • A server which sends system time in response
  • Both are IPv4 & IPv6 compatible and use multiplexing

Building

$ mkdir build
$ cd build
$ cmake ..
$ make

Requires a C++14 compiler.

Usage

Server:
ntp-server [<port number>]
E.g. ./ntp-server 8080

Client:
ntp-client [<server hostname or address> [<server port>]]
E.g. ./ntp-client localhost 8080, ntp-client
Available commands are ask and quit.

Testing

Tested by hand on Linux 4.12 and FreeBSD 12.0.

Copyright

Ilya Bizyaev, 2019 ([email protected])

Licensed under MIT terms.

About

🌐 Platform-specific multiplexing API demo

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • C++ 89.3%
  • C 6.7%
  • CMake 4.0%