Skip to content

Wood-Xia/fibio

 
 

Repository files navigation

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;

bool handler(server::request &req,
             server::response &resp)
{
    resp.body_stream() << "<HTML><BODY><H1>"
                       << req.params["p"]
                       << "</H1></BODY></HTML>"
                       << std::endl;
    return true;
}

int fibio::main(int argc, char *argv[]) {
    server svr(server::settings{
        route(path_("/*p") >> handler),
        23456,
    });
    svr.start();
    svr.join();
}

About

Fiber and async I/O based network library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 59.6%
  • C 40.4%