Topic: wolfSSL epoll single threaded asynchronous/event-driven server example

I'm trying to use wolfSSL to my already existing `epoll` based single-threaded asynchronous/event-driven server. I was looking for a minimal `epoll` example which uses `EPOLLOUT`, `EPOLLIN`, and `EPOLLERR` function handlers which will be dispatched accordingly. I saw `server-tls-nonblocking.c` but it is blocking or rather cannot handle multiple connections in an asynchronous fashion the other `epoll` based examples shown on the `wolfssl-examples` are not minimal or something I was not looking for (like the epoll examples does so much than just epoll) and it's not really super useful for me since it does many other things.

It would be really helpful for me if someone could give me an idea/pseudocode for a single-threaded event-driven epoll server example which uses wolfSSL Async functions/handlers. Right now, my implementation (clear-text server HTTP server) first, calls a handler `OnConnect` which will be called when a client connects for the first time, and `OnReadyRecv` and `OnReadySend` for respective non-blocking `send()` and `recv()` calls by watching events like `EPOLLIN` and `EPOLLOUT` and dispatch accordingly. It would be super helpful for me if someone could provide a very minimal epoll example (without all the thread-poll, client cert authentication, and all that jazz)

Thank You

Share

Re: wolfSSL epoll single threaded asynchronous/event-driven server example

Hi sapi01,

The best epoll examples we have are in wolfssl-examples/tls.
https://github.com/wolfSSL/wolfssl-exam … oll-perf.c

Thanks,
David Garske, wolfSSL

Share

Re: wolfSSL epoll single threaded asynchronous/event-driven server example

Hi dgarske,
Will you accept a little simplified version of epoll() based single-threaded event-driven server example as a PR? (simplified version compared to the epoll() server examples on the wolfssl-example repo)

Thanks

Share

Re: wolfSSL epoll single threaded asynchronous/event-driven server example

Hi sapi01,

Yes feel free to put up a PR. In order to merge it we would need a signed contributor agreement. For that please email support@wolfssl.com with your contact information and a link to the PR once it is posted.

Thanks,
David Garske, wolfSSL

Share