Giter Site home page Giter Site logo

dot's Introduction

Dot {#mainpage}

Asynchronous network library for C++ targeted for TCP/IPv4 stack with no protocol overhead

Why no protocol overhead?

Because Dot does not have protocol. Read and writes are performed for binary and text which means protcols can be implemented in Dot. For modularity reasons Dot does not perform encyption or decryption.

Why the dot terminology?

A Dot can be said to be the smallest breakable part in a picture. When imagining a network with several different dots(devices), operations on dot become intuitive

A general usage of Dot would require

#include <Dot/Dot.hpp>
#include <Dot/DotOperationEvent.hpp>
using namespace dot;
Dot &dot = Dot::getDot();
dot.on(DotOperationEvent::CONNECTED, [](Dot &dot){
  dot.write("hi node");
});
dot.connect("localhost", 3500);

Peer to peer Chat application using dot

using namespace std;
Dot &dot = Dot::getDot();
dot.on(DotOperationEvent::CONNECTED, [](Dot &dot, string message){
  dot.readFor("*").on(DotEventOperation::SUCCESS, [](Dot &dot){ //read any string
    string message;
    cout << message << endl;//hook with ui
  });
  std::string message = " ";
  while(message != "\q"){
    cin >> message;
    dot.write(message).on(DotOperationEvent::SUCCESS, [](Dot &dot, string message){

    });
  }
});
dot.connect("localhost", 3500);
return dot.run(); //runs unless dot is explicitly asked to disconnect

Installation

Dot can be installed with CMake on any POSIX like system with

mkdir build
cd build/
cmake ..
make
make install

Minimum Requirements

Dot relies on C++11 lambda functions Compiles on gcc, clang, mingw and cygwin

dot's People

Contributors

bharatvaj avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.