4 ms·
Has anyone used this in a multithreaded implementation, and how is/was the experience?
by dpflan 5y ago
Has anyone used this in a multithreaded implementation, and how is/was the experience?
- Galanwe 5y agoI used to roll my own code for websockets since the protocol is so simple. Switched to libwebsockets when I had to support TLS since I did not wanted to fiddle with openssl directly. Overall the experience was good. It's simple, to the point. Configuration of the library is a bit like dark magic though, not much documentation. > Has anyone used this in a multithreaded implementation It's an event loop based library, so the point is more to have a single asynchronous main thread that fetches the messages, which you can dispatch to threads for processing if you wish.
- vlovich123 5y agoHave you tried libkj? It’s the c++ runtime that underpowers Cap’n’proto’s RPC layer as well as Cloudflare Workers. Has many of the same features - curious how you find the documentation. Disclaimer: I work at Cloudflare.
- Galanwe 5y agoI would love to, but I stopped bothering with C++ a long time ago, and just use C nowadays :-)
- clappski 5y ago>I did not wanted to fiddle with openssl directly It's actually fairly simple to use openssl directly if you have a good handle of sockets in general, it's basically just a case of doing some initialisation and using SSL_write/SSL_read in place of whatever write/read functions you were using before to write to the socket
- nurettin 5y agoYes, you run it on its own thread and output messages to a threadsafe queue for other threads to consume as is the usual practice. Or did you ask for something else?
- winrid 5y agoYou can just fork multiple threads that are each their own server, and then do communication over thread safe queues to workers in other threads.