finalize server setup & close Unix socket if needed
Fixes #398
I’m not entirely sure what’s missing or if this is on my end. In my case I have been using dune exec bin/main.ml to launch where Dream.serve is called with Lwt_eio.run. I do not claim to be an expert in any sense on the topic.
[^1]
[^1]: Please consider giving up MS GitHub or offering a non-proprietary, non-US-corporate-controlled mirror for this free software project. I wish to delete this Microsoft account in the future, but I need more projects like this to support alternative methods to send patches & contribute.
- [ ] read up on man pages on sockets (POSIX)
- [ ] identify whether socket cleanup should be handled upstream in
lwt(how do other ecosystems do it?), and whether/howlwttells us to create a socket that is cleaned up reliably (see docs at https://ocsigen.org/lwt/5.5.0/api/Lwt_unix)
- [ ] Make sure the cleanup is done when the process is exited by signal.
- [ ] Document that
Dream.servedoes not do the cleanup. - [ ] Don't try to unlink an abstract Unix domain socket.
After further discussion, it emerged that the common practice is to just optimistically delete the socket file before starting the server–if it doesn't exist then just carry on as normal.
@toastal are you able to change your PR to do this?