zirias@
Developer
Recently, there was a thread about "async sockets". So I thought I'll let you know about:
I just added devel/poser to our tree!
This is a lightweight and portable framework for implementing services in C, using only standard POSIX APIs. It offers an event-based and "modern" API that should be pretty easy to use. It features a main service loop around
API docs can be found here: https://zirias.github.io/poser
In a nutshell, this might be for you if you want to implement an async service in a simple and painless way in C and don't need to scale to more than around 100 concurrent connections, but want to keep it small and simple with little dependencies.
It's definitely not for you if you need to scale to thousands of concurrent connections. In that case, better look for solutions abstracting all the OS-specific solutions (like e.g. kqueue on FreeBSD and epoll on Linux) like e.g. libev.
I just added devel/poser to our tree!
This is a lightweight and portable framework for implementing services in C, using only standard POSIX APIs. It offers an event-based and "modern" API that should be pretty easy to use. It features a main service loop around
pselect()
, raising events when any file descriptor is ready for reading or writing, a (configurable) threadpool (just create a ThreadJob
and schedule it for execution, you will get an event when it finished), generic "daemonizing" code (just give it a location for a pidfile, it handles anything else including correct locking), abstractions for socket connections and servers (supports TCP and local UNIX sockets), and a few utility classes (like a List
, a HashTable
and so on). TLS support is optional at build time and on by default, and works completely transparent, just enable it when configuring your client or server. The library strictly uses non-blocking I/O and does everything async (and, if not supported by POSIX APIs, simulates async by doing the job on a thread of the threadpool).API docs can be found here: https://zirias.github.io/poser
In a nutshell, this might be for you if you want to implement an async service in a simple and painless way in C and don't need to scale to more than around 100 concurrent connections, but want to keep it small and simple with little dependencies.
It's definitely not for you if you need to scale to thousands of concurrent connections. In that case, better look for solutions abstracting all the OS-specific solutions (like e.g. kqueue on FreeBSD and epoll on Linux) like e.g. libev.