Skip to content
/ kqnet Public

My own C++14 Networking library that uses asio

Notifications You must be signed in to change notification settings

Robertkq/kqnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kqnet is a easy-to-use networking library written in C++14, internally it uses asio to perform asynchronous communication.

The library implements client_interface<T>, server_interface<T>, connection<T>, message<T>.

The template argument typename T should be an enum, whose role is to define IDs for the messages.

client_interface<T> does not require the end user to implement any pure virtual functions.

server_interface<T> requires the user to implement the following 5 functions:

virtual bool OnClientConnect(connection<T>* client) = 0;
virtual void OnClientDisconnect(connection<T>* client) = 0;
virtual void OnClientValidated(connection<T>* client) = 0;
virtual void OnClientUnvalidated(connection<T>* client) = 0;
virtual void OnMessage(connection<T>* client, message<T>& msg) = 0;

Examples:

Simple chat room The Wired

About

My own C++14 Networking library that uses asio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published