Skip to content

StephanDollberg/twistedcpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twistedcpp

Porting twisted to C++ using boost::asio coroutines.

#include <twisted/reactor.hpp>
#include <twisted/basic_protocol.hpp>

struct echo_protocol : twisted::basic_protocol<echo_protocol> {
    void on_message(const_buffer_iterator begin, const_buffer_iterator end) { 
        send_message(begin, end);
    }
};

int main() {
    twisted::reactor reac;
    reac.listen_tcp<echo_protocol>(50000);
    reac.run();
}

Feature Support

Check the [Tutorials] (https://github.com/StephanDollberg/twistedcpp/wiki/Tutorials) for a detailed explanation of everything.

Using/Installing twistedcpp

twistedcpp is header only so you don't need to build anything. You can either add include/twisted to your compiler include path(e.g.: -I/path/to/twisted/include or put it to /usr/local/include) or copy the files to your local project. However, twistedcpp depends on boost asio and if the ssl part is used also on openssl. Meaning that you have to link against -lboost_coroutine, -lboost_context, -lboost_system, -lssl and -lcrypto.

More work, help and projects very appreciated.

About

Porting Twisted to C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published