diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-26 12:43:59 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-26 13:54:08 -0800 |
| commit | e3178bd34ced788b8e16e5e0c3e8f712cd41de6a (patch) | |
| tree | c1793d18f8f5fb596e7301f29984f1d6308bc320 /src/platform/posix/posix_tcpconn.c | |
| parent | fdcb65091eb6c8875bba382072f7f333be972ce1 (diff) | |
| download | nng-e3178bd34ced788b8e16e5e0c3e8f712cd41de6a.tar.gz nng-e3178bd34ced788b8e16e5e0c3e8f712cd41de6a.tar.bz2 nng-e3178bd34ced788b8e16e5e0c3e8f712cd41de6a.zip | |
tcp: use nni_aio_start
Diffstat (limited to 'src/platform/posix/posix_tcpconn.c')
| -rw-r--r-- | src/platform/posix/posix_tcpconn.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/platform/posix/posix_tcpconn.c b/src/platform/posix/posix_tcpconn.c index c23e1840..9837a839 100644 --- a/src/platform/posix/posix_tcpconn.c +++ b/src/platform/posix/posix_tcpconn.c @@ -283,16 +283,11 @@ static void tcp_send(void *arg, nni_aio *aio) { nni_tcp_conn *c = arg; - int rv; - if (nni_aio_begin(aio) != 0) { - return; - } + nni_aio_reset(aio); nni_mtx_lock(&c->mtx); - - if ((rv = nni_aio_schedule(aio, tcp_cancel, c)) != 0) { + if (!nni_aio_start(aio, tcp_cancel, c)) { nni_mtx_unlock(&c->mtx); - nni_aio_finish_error(aio, rv); return; } nni_aio_list_append(&c->writeq, aio); @@ -313,16 +308,11 @@ static void tcp_recv(void *arg, nni_aio *aio) { nni_tcp_conn *c = arg; - int rv; - if (nni_aio_begin(aio) != 0) { - return; - } + nni_aio_reset(aio); nni_mtx_lock(&c->mtx); - - if ((rv = nni_aio_schedule(aio, tcp_cancel, c)) != 0) { + if (!nni_aio_start(aio, tcp_cancel, c)) { nni_mtx_unlock(&c->mtx); - nni_aio_finish_error(aio, rv); return; } nni_aio_list_append(&c->readq, aio); |
