davidkennedydev / cpp-simple-sockets

Because network connections can be simple

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Codecov

Travis Travis

Quality gate Security Maintainability Reliability

Vulnerabilities Lines Duplication Bugs

cpp-simple-sockets

An stupid library to use sockets easy.

Client-Server

Client-server applications can be simple writed like below.

Client side

Connection server("localhost", "12345"); // Open a connection with the server.

server << "Hey server, are you here?" << std::endl; 

string response;
server >> response;

Server side

Connection client(12345); // Waits for client connections on 12345

// Everything bellow will be asynchronously executed to each client connected.
string question;
client >> question;

client << "Hi client. I'm your server." << std::endl;

Current features

  • Output buffer to socket asio;
  • Input buffer to sockets asio;
  • Client socket stream;
  • Server socket stream;
  • Server socket stream factory;
  • Connection behaviour like client side and multiclient server side;

Builds

  • This Dockerfile build and test on ubuntu with gcc. Build and run that container with command:

    sudo docker build -t daviduser/cpp-simple-sockets .
    
    sudo docker run --rm -it daviduser/cpp-simple-sockets
    

    To run that and get a command line use the docker run command:

    sudo docker run --rm -it daviduser/cpp-simple-sockets /bin/bash
    
    
  • The .travis.yml configure build on travis-ci

About

Because network connections can be simple

License:MIT License


Languages

Language:C++ 92.2%Language:Makefile 5.1%Language:Dockerfile 2.7%