Discussion:
[INFO] Libasyncd - Embeddable Asynchronous Message/HTTP Server library for C/C++
(too old to reply)
Seungyoung Kim
2014-04-18 09:04:47 UTC
Permalink
Raw Message
Hi,

I'd like to introduce a new library, Libasyncd based on libevent.

Libasyncd is an embeddable event-driven asynchronous message server for
C/C++. It supports HTTP protocol by default and you can add your own
protocol handler(hook) to build your own high performance server.

*GitHub: https://github.com/wolkykim/libasyncd
<https://github.com/wolkykim/libasyncd>*

Asynchronous way of programming can easily go quite complicated since you
need to handle every possible things in non-blocking way. So the goal of
Libasyncd project is to make a flexible and fast asynchronous server
framework with nice abstraction that can cut down the complexity.
For your quick reference, here's how it looks.

int my_http_get_handler(short event, ad_conn_t *conn, void *userdata) {
if (ad_http_get_status(conn) == AD_HTTP_REQ_DONE) {
ad_http_response(conn, 200, "text/html", "Hello World", 11);
return AD_DONE; // Keep connection alive.
}
return AD_OK;
}

int main(int argc, char **argv) {
ad_log_level(AD_LOG_DEBUG);
ad_server_t *server = ad_server_new();
ad_server_set_option(server, "server.port", "8888");
ad_server_set_option(server, "server.ssl_cert", "ssl.cert");
ad_server_set_option(server, "server.ssl_pkey", "ssl.pkey")
ad_server_register_hook(server, ad_http_handler, NULL); // HTTP
Parser is also a hook.
ad_server_register_hook(server, my_http_get_handler, NULL);
return ad_server_start(server);
}

I'd love to get your feedback.
And I'm also looking for someone who's willing to work together.

Thanks

Loading...