diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-08 14:16:23 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-08 18:54:09 -0800 |
| commit | d606317f5c028fa8fba5d5384b0ccd90ffa4eab5 (patch) | |
| tree | 3a6a70f6f2dc81b8722134752716f1c58bd1825c /src/platform/windows | |
| parent | e9efefca683b244b40f831c554d7c72a745b8372 (diff) | |
| download | nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.tar.gz nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.tar.bz2 nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.zip | |
fixes #171 Refactor aio to use generic data fields
This addresses the use of the pipe special field, and eliminates it.
The message APIs (recvmsg, sendmsg) need to be updated as well still,
but I want to handle that as part of a separate issue.
While here we fixed various compiler warnings, etc.
Diffstat (limited to 'src/platform/windows')
| -rw-r--r-- | src/platform/windows/win_ipc.c | 6 | ||||
| -rw-r--r-- | src/platform/windows/win_tcp.c | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/platform/windows/win_ipc.c b/src/platform/windows/win_ipc.c index 63ba8a67..9851af25 100644 --- a/src/platform/windows/win_ipc.c +++ b/src/platform/windows/win_ipc.c @@ -321,7 +321,8 @@ nni_win_ipc_acc_finish(nni_win_event *evt, nni_aio *aio) return; } - nni_aio_finish_pipe(aio, pipe); + nni_aio_set_output(aio, 0, pipe); + nni_aio_finish(aio, 0, 0); } static void @@ -448,7 +449,8 @@ nni_win_ipc_conn_thr(void *arg) ((rv = nni_win_iocp_register(p)) != 0)) { goto fail; } - nni_aio_finish_pipe(aio, pipe); + nni_aio_set_output(aio, 0, pipe); + nni_aio_finish(aio, 0, 0); continue; fail: diff --git a/src/platform/windows/win_tcp.c b/src/platform/windows/win_tcp.c index 254cf40b..6d58d495 100644 --- a/src/platform/windows/win_tcp.c +++ b/src/platform/windows/win_tcp.c @@ -105,7 +105,7 @@ nni_win_tcp_pipe_start(nni_win_event *evt, nni_aio *aio) DWORD niov; DWORD flags; nni_plat_tcp_pipe *pipe = evt->ptr; - int i; + unsigned i; unsigned naiov; nni_iov * aiov; WSABUF * iov; @@ -469,7 +469,8 @@ nni_win_tcp_acc_finish(nni_win_event *evt, nni_aio *aio) memcpy(&pipe->sockname, sa1, len1); memcpy(&pipe->peername, sa2, len2); - nni_aio_finish_pipe(aio, pipe); + nni_aio_set_output(aio, 0, pipe); + nni_aio_finish(aio, 0, 0); } static int @@ -512,7 +513,6 @@ nni_win_tcp_acc_start(nni_win_event *evt, nni_aio *aio) void nni_plat_tcp_ep_accept(nni_plat_tcp_ep *ep, nni_aio *aio) { - nni_aio_set_pipe(aio, NULL); nni_win_event_submit(&ep->acc_ev, aio); } @@ -562,7 +562,8 @@ nni_win_tcp_con_finish(nni_win_event *evt, nni_aio *aio) len = sizeof(pipe->sockname); (void) getsockname(s, (SOCKADDR *) &pipe->sockname, &len); - nni_aio_finish_pipe(aio, pipe); + nni_aio_set_output(aio, 0, pipe); + nni_aio_finish(aio, 0, 0); } static int @@ -632,7 +633,6 @@ nni_win_tcp_con_start(nni_win_event *evt, nni_aio *aio) extern void nni_plat_tcp_ep_connect(nni_plat_tcp_ep *ep, nni_aio *aio) { - nni_aio_set_pipe(aio, NULL); nni_win_event_submit(&ep->con_ev, aio); } |
