zhongchin / fibio

Fiber and async I/O based network library

Home Page:http://fiberized.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

Fiberized.IO

Fiberized.IO is a fast and simple networking framework without compromises.

  • Fast
    Asynchronous I/O under the hood for maximum speed and throughtput.
  • Simple
    Fiber based programming model for concise and intuitive development.
  • No compromises
    Standard C++ thread and iostream compatible API, old-fashion programs just work more efficiently.

Read the Wiki for manuals and references

The echo server example

#include <fibio/fiberize.hpp>
#include <fibio/iostream.hpp>
 
using namespace fibio;
 
int fibio::main(int argc, char *argv[]) {
    return tcp_listener(7)([](tcp_stream &s){
        s << s.rdbuf();
    }).value();
}

The HTTP server example

#include <fibio/fiberize.hpp>
#include <fibio/http_server.hpp>

using namespace fibio::http;
 
int fibio::main(int argc, char *argv[]) {
    return server(23456).handler(
        route(
            path_("/add/:x/:y")>>[](double x, double y){return x+y;}
        )
    ).run().value();
}

About

Fiber and async I/O based network library

http://fiberized.io

License:BSD 2-Clause "Simplified" License


Languages

Language:C++ 65.4%Language:C 33.1%Language:CMake 1.5%Language:Thrift 0.0%