Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.
/ cpp-socket-server Public archive

configurable C/C++ multi-threaded socket server template for Unix-based systems with logging as basis for different projects to get data from different clients and process it directly in C/C++

License

Notifications You must be signed in to change notification settings

brean/cpp-socket-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp-server-template

configurable C/C++ multi-threaded socket server template for Unix-based systems with logging as basis for different projects to get data from different clients and process it directly in C/C++

Use this template to create your own server.

used libaries

This project needs

  • POSIX Threads for threading (aka pthread, provided by glibc, included in Unix-Systems)
  • Boost.Log for logging
  • yaml-cpp for configuration

requirements installation

For fedora:

# dnf install glibc-devel boost-devel yaml-cpp-devel

compile and run demo

This project uses CMake for compilation. Just run

$ cmake CMakeList.txt

to create all files required for compiling, then run make to compile

$ make

you can now compile and start one of the example servers (e.g. the broadcast server):

$ cd examples/broadcast
$ cmake CMakeList.txt && make
$ cd -
$ ./examples/broadcast/broadcast

Thison example accepts connections from port 7000 (configured in the config.yml). Take a look at the example clients(TODO!) or connect using telnet:

$ telnet localhots 7000

configuration

If you like to change the port or adress the server is listening on just change the config.yml-file in the main folder.

example projects

(TODO)

About

configurable C/C++ multi-threaded socket server template for Unix-based systems with logging as basis for different projects to get data from different clients and process it directly in C/C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published