From 5f7289e1f8e1427c9214c8e3e96ad56b1f868d53 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 4 Apr 2018 13:36:54 -0700 Subject: fixes #334 Separate context for state machines from sockets This provides context support for REQ and REP sockets. More discussion around this is in the issue itself. Optionally we would like to extend this to the surveyor pattern. Note that we specifically do not support pollable descriptors for non-default contexts, and the results of using file descriptors for polling (NNG_OPT_SENDFD and NNG_OPT_RECVFD) is undefined. In the future, it might be nice to figure out how to factor in optional use of a message queue for users who want more buffering, but we think there is little need for this with cooked mode. --- src/core/aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/aio.c') diff --git a/src/core/aio.c b/src/core/aio.c index 9cf04217..3027b0c1 100644 --- a/src/core/aio.c +++ b/src/core/aio.c @@ -324,6 +324,7 @@ nni_aio_start(nni_aio *aio, nni_aio_cancelfn cancelfn, void *data) } if (!aio->a_sleep) { + // Convert the relative timeout to an absolute timeout. switch (aio->a_timeout) { case NNG_DURATION_ZERO: aio->a_expire = NNI_TIME_ZERO; @@ -338,7 +339,6 @@ nni_aio_start(nni_aio *aio, nni_aio_cancelfn cancelfn, void *data) } } - // Convert the relative timeout to an absolute timeout. if (aio->a_expire != NNI_TIME_NEVER) { nni_aio_expire_add(aio); } -- cgit v1.2.3-70-g09d2