aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-03-12 17:37:33 -0700
committerGarrett D'Amore <garrett@damore.org>2018-03-12 17:37:33 -0700
commit55e98ae58c5856c1808e3fccb2548a76c9b8907c (patch)
tree8dcb25ea029f87074276ad01d2bda21d1746ca5b /docs
parent2f1e799d1225b18e960d426d35b6a83fa80db86f (diff)
downloadnng-55e98ae58c5856c1808e3fccb2548a76c9b8907c.tar.gz
nng-55e98ae58c5856c1808e3fccb2548a76c9b8907c.tar.bz2
nng-55e98ae58c5856c1808e3fccb2548a76c9b8907c.zip
nng_sleep_aio should honor aio timeout.
The first problem was that using nng_sleep_aio was found to reset the timeout, and this caused subsequent operations to start failing with timeouts when reusing the AIO for other operations. The second thing is that we think it would be nicer if the presence of real aio timeouts were still honored, so that if the timeout is shorter than the sleep time, then we get back an NNG_ETIMEDOUT like every other operation, and we get back a 0 if the logical sleep operation completes normally.
Diffstat (limited to 'docs')
-rw-r--r--docs/man/nng_sleep_aio.adoc9
1 files changed, 4 insertions, 5 deletions
diff --git a/docs/man/nng_sleep_aio.adoc b/docs/man/nng_sleep_aio.adoc
index dff00219..8181046d 100644
--- a/docs/man/nng_sleep_aio.adoc
+++ b/docs/man/nng_sleep_aio.adoc
@@ -26,12 +26,11 @@ void nng_sleep_aio(nng_duration msec, nng_aio *aio);
The `nng_sleep_aio()` function performs an asynchronous "`sleep``",
causing the callback for _aio_ to be executed after _msec_ milliseconds.
-This is logically the equivalent of starting an asynchronous operation
-that does nothing at all, but expires after _msec_ duration, _except_ that
-the completion result will be zero rather `NNG_ETIMEDOUT`.
+If the sleep finishes completely, the result will always be zero.
-NOTE: This overrides and replaces any timeout on the _aio_ set with
-<<nng_aio_set_timeout#,nng_aio_set_timeout(3)>>.
+NOTE: If a timeout is set on _aio_ using
+<<nng_aio_timeout#,nng_aio_set_timeout(3)>>, and it is shorter than _msec_,
+then the sleep will wake up early, with a result code of `NNG_ETIMEDOUT`.
== RETURN VALUES