ocaml-cohttp
ocaml-cohttp copied to clipboard
Cohttp_lwt_unix.Server.create should indicate when server is running
Currently, it starts listening on the given port and returns a thread that can be cancelled, but there's no way to know when it is ready (i.e. when connections to the socket will succeed). This is important for knowing when clients that want to connect to the server can be started.
The create function ought to block until the socket is ready to accept -- a bug otherwise.
On 21 Oct 2015, at 05:04, Thomas Leonard [email protected] wrote:
Currently, it starts listening on the given port and returns a thread that can be cancelled, but there's no way to know when it is ready (i.e. when connections to the socket will succeed). This is important for knowing when clients that want to connect to the server can be started.
— Reply to this email directly or view it on GitHub https://github.com/mirage/ocaml-cohttp/issues/435.
It blocks for the whole time the server is running, not just until it starts.