Apparently spawning a child process/app that outlives the parent (on Windows and Linux/MacOS) in #Rust is hard. Forking would work if it was cross platform.

If you know a good way to do this please share.

For now the best way seems to be to use a cross-platform #daemonization library (I think I found one), and then have the parent run a command to start the daemon.

Seems wildly over the top to have my CLI program start the server it wants to talk to if it isn't already running. 🤔 #RustLang

Just released: #poser v1.2:

https://github.com/Zirias/poser/releases/tag/v1.2

poser is my framework for implementing #POSIX #services (POsix SERvices 🙈) in plain #C using just POSIX APIs.

It uses select() for its main event loop (so, scaling is limited to around a few hundred concurrent connections; if you need more, better look at libevent and similar!), offers correct (non-systemd!) #daemonization, abstractions for stream #sockets (#TCP and local Unix), optional #TLS support and a few utility classes (List, HashTable, ...).

The new release includes improvements (an individual Timer class!) and several bugfixes I needed while developing #Xmoji. I early on decided to use poser for Xmoji because a GUI application is pretty similar to a service, typically built around one main event loop 😉

Release poser-1.2 · Zirias/poser

New Feature: PSC_Timer allows to create arbitrary individual timers. The Service "tick timer" still exists, now using one PSC_Timer itself. New Feature: PSC_Log_enabled() allows to check whether a ...

GitHub