diff options
| author | Garrett D'Amore <garrett@damore.org> | 2021-12-27 23:10:29 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2021-12-27 23:10:29 -0800 |
| commit | 2fbfd7e5c3ad245de2c905720eb8d9d5b27b6739 (patch) | |
| tree | 2907ec3f298b2b38827060623d3f6e2577dda011 /include | |
| parent | 7b02ddc2d7077439992a10bb69553f89b5ee5903 (diff) | |
| download | nng-2fbfd7e5c3ad245de2c905720eb8d9d5b27b6739.tar.gz nng-2fbfd7e5c3ad245de2c905720eb8d9d5b27b6739.tar.bz2 nng-2fbfd7e5c3ad245de2c905720eb8d9d5b27b6739.zip | |
Introduce nng_device_aio().
This function is like nng_device(), but runs asynchronously.
Also, this fixes #1503 nng_device causes nng_close to blocking
Diffstat (limited to 'include')
| -rw-r--r-- | include/nng/nng.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h index d40f5135..bb3b6b14 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -973,8 +973,18 @@ NNG_DECL uint64_t nng_stat_timestamp(nng_stat *); // Device functionality. This connects two sockets together in a device, // which means that messages from one side are forwarded to the other. +// This version is synchronous, which means the caller will block until +// one of the sockets is closed. Note that caller is responsible for +// finally closing both sockets when this function returns. NNG_DECL int nng_device(nng_socket, nng_socket); +// Asynchronous form of nng_device. When this succeeds, the device is +// left intact and functioning in the background, until one of the sockets +// is closed or the application exits. The sockets may be shut down if +// the device fails, but the caller is responsible for ultimately closing +// the sockets properly after the device is torn down. +NNG_DECL void nng_device_aio(nng_aio *, nng_socket, nng_socket); + // Symbol name and visibility. TBD. The only symbols that really should // be directly exported to runtimes IMO are the option symbols. And frankly // they have enough special logic around them that it might be best not to |
