Skip to content

davidkennedydev/cpp-simple-sockets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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