From 9c6b2929d8019dcc11935550bc3520ae39c2964e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 30 Dec 2024 11:45:36 -0800 Subject: fixes #863 socket activation: for TCP and IPC (POSIX only) This introduces a new option "NNG_OPT_LISTEN_FD", understood by TCP, TLS, and (on POSIX systems) IPC. This option is used to pass a file descriptor or handle (Windows) that is already listening (ready for ACCEPT to be called). For TCP and TLS, the socket must be of type AF_INET or AF_INET6, and for IPC it must be of type AF_UNIX. --- docs/man/nng_tcp_options.5.adoc | 10 ++++++++++ docs/ref/tran/ipc.md | 1 + 2 files changed, 11 insertions(+) (limited to 'docs') diff --git a/docs/man/nng_tcp_options.5.adoc b/docs/man/nng_tcp_options.5.adoc index ad5fabfd..37228b82 100644 --- a/docs/man/nng_tcp_options.5.adoc +++ b/docs/man/nng_tcp_options.5.adoc @@ -101,6 +101,16 @@ system. While the value is of type `int`, it will be a legal TCP port number, that is a value between 1 and 65535, inclusive. +[[NNG_OPT_LISTEN_FD]] +((`NNG_OPT_LISTEN_FD`)): +(`int`) +This option is a write-only option for listeners, that can be used on a +listener that has not yet been started. It is used to pass in a file descriptor +(or for Windows, a `SOCKET`) that has already been set up for listening. +The intended use for this is with configurations such as socket activation, +where some system service pre-establishes the listening sockets before starting +the application. + === Inherited Options Generally, the following option values are also available for TCP objects, diff --git a/docs/ref/tran/ipc.md b/docs/ref/tran/ipc.md index ec0a2700..3d52f106 100644 --- a/docs/ref/tran/ipc.md +++ b/docs/ref/tran/ipc.md @@ -83,6 +83,7 @@ where supported by the underlying platform. - [`NNG_OPT_PEER_PID`][NNG_OPT_PEER_PID] - [`NNG_OPT_PEER_UID`][NNG_OPT_PEER_UID] - [`NNG_OPT_PEER_ZONEID`][NNG_OPT_PEER_ZONEID] +- [`NNG_OPT_LISTEN_FD`][NNG_OPT_LISTEN_FD] ### Other Configuration Parameters -- cgit v1.2.3-70-g09d2