Skip to content

Commit

Permalink
Merge pull request #282 from timbertson/systemd
Browse files Browse the repository at this point in the history
add server type (`Listening_socket of Lwt_unix.file_descr)
  • Loading branch information
avsm authored Jul 15, 2019
2 parents 00123fd + 77ec09c commit ad9970f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lwt-unix/conduit_lwt_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type server = [
| `Vchan_direct of int * string
| `Vchan_domain_socket of string * string
| `Launchd of string
| `Listening_socket of Lwt_unix.file_descr sexp_opaque
] [@@deriving sexp]

type tls_server_key = [
Expand Down Expand Up @@ -340,6 +341,8 @@ let serve ?backlog ?timeout ?stop
|`Vchan_direct _ -> Lwt.fail_with "Vchan_direct not implemented"
| `Vchan_domain_socket _uuid ->
Lwt.fail_with "Vchan_domain_socket not implemented"
| `Listening_socket s ->
Sockaddr_server.init ~on:(`Socket s) ?timeout ?stop callback
| `Launchd name ->
let fn s = Sockaddr_server.init ~on:(`Socket s) ?timeout ?stop callback in
Conduit_lwt_launchd.activate fn name
Expand Down
2 changes: 2 additions & 0 deletions lwt-unix/conduit_lwt_unix.mli
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type server_tls_config =
- [`Unix_domain_socket (`File path)]: Use UNIX domain sockets to listen on the path.
- [`Vchan_direct (domid, port)]: Listen for the remote VM on the [domid], [port] tuple.
- [`Vchan_domain_socket (domain, port_name)]: Use the Vchan name resolution to listen
- [`Listening_socket fd]: Use the socket given, useful for inherited systemd sockets.
- [`Launchd name]: uses MacOS X launchd to start the service, via the name
of the [Sockets] element within the service description plist file. See the
{{:http://mirage.github.io/ocaml-launchd/launchd/}ocaml-launchd} documentation for more.
Expand All @@ -90,6 +91,7 @@ type server = [
| `TLS_native of server_tls_config
| `TCP of [ `Port of int ]
| `Unix_domain_socket of [ `File of string ]
| `Listening_socket of Lwt_unix.file_descr
| `Vchan_direct of int * string
| `Vchan_domain_socket of string * string
| `Launchd of string
Expand Down

0 comments on commit ad9970f

Please sign in to comment.