diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-02-16 12:40:41 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-02-16 19:22:27 -0800 |
| commit | 60231f0600461a9593a8f876518874866df3387a (patch) | |
| tree | 1a91f0b65b1ad2d5b995a3db21639f4bf7032066 /src/platform/windows | |
| parent | 5cf750697624d4fd63cfe26921209d7c30e1a2d2 (diff) | |
| download | nng-60231f0600461a9593a8f876518874866df3387a.tar.gz nng-60231f0600461a9593a8f876518874866df3387a.tar.bz2 nng-60231f0600461a9593a8f876518874866df3387a.zip | |
fixes #879 Desire NNG_OPT_TCP_BOUND_PORT
We also have made some support changes, including new APIs for printing
URLs, and some improvements to the NNG_OPT_URL to make use of this new
property.
Diffstat (limited to 'src/platform/windows')
| -rw-r--r-- | src/platform/windows/win_tcp.h | 16 | ||||
| -rw-r--r-- | src/platform/windows/win_tcpconn.c | 2 | ||||
| -rw-r--r-- | src/platform/windows/win_tcpdial.c | 2 | ||||
| -rw-r--r-- | src/platform/windows/win_tcplisten.c | 16 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/platform/windows/win_tcp.h b/src/platform/windows/win_tcp.h index b37b2353..e54f853c 100644 --- a/src/platform/windows/win_tcp.h +++ b/src/platform/windows/win_tcp.h @@ -38,20 +38,6 @@ struct nni_tcp_conn { nni_cv cv; }; -struct nni_tcp_listener { - SOCKET s; - nni_list aios; - bool closed; - bool started; - bool nodelay; // initial value for child conns - bool keepalive; // initial value for child conns - LPFN_ACCEPTEX acceptex; - LPFN_GETACCEPTEXSOCKADDRS getacceptexsockaddrs; - SOCKADDR_STORAGE ss; - nni_mtx mtx; - nni_reap_item reap; -}; - -extern int nni_win_tcp_conn_init(nni_tcp_conn **, SOCKET); +extern int nni_win_tcp_init(nni_tcp_conn **, SOCKET); #endif // NNG_PLATFORM_WIN_WINTCP_H diff --git a/src/platform/windows/win_tcpconn.c b/src/platform/windows/win_tcpconn.c index c77bbc72..429c5a5d 100644 --- a/src/platform/windows/win_tcpconn.c +++ b/src/platform/windows/win_tcpconn.c @@ -425,7 +425,7 @@ tcp_free(void *arg) } int -nni_win_tcp_conn_init(nni_tcp_conn **connp, SOCKET s) +nni_win_tcp_init(nni_tcp_conn **connp, SOCKET s) { nni_tcp_conn *c; int rv; diff --git a/src/platform/windows/win_tcpdial.c b/src/platform/windows/win_tcpdial.c index 6bb3d92a..e295bd8d 100644 --- a/src/platform/windows/win_tcpdial.c +++ b/src/platform/windows/win_tcpdial.c @@ -193,7 +193,7 @@ nni_tcp_dial(nni_tcp_dialer *d, nni_aio *aio) return; } - if ((rv = nni_win_tcp_conn_init(&c, s)) != 0) { + if ((rv = nni_win_tcp_init(&c, s)) != 0) { nng_stream_free(&c->ops); nni_aio_finish_error(aio, rv); return; diff --git a/src/platform/windows/win_tcplisten.c b/src/platform/windows/win_tcplisten.c index e98a0c37..18e552a6 100644 --- a/src/platform/windows/win_tcplisten.c +++ b/src/platform/windows/win_tcplisten.c @@ -17,6 +17,20 @@ #include "win_tcp.h" +struct nni_tcp_listener { + SOCKET s; + nni_list aios; + bool closed; + bool started; + bool nodelay; // initial value for child conns + bool keepalive; // initial value for child conns + LPFN_ACCEPTEX acceptex; + LPFN_GETACCEPTEXSOCKADDRS getacceptexsockaddrs; + SOCKADDR_STORAGE ss; + nni_mtx mtx; + nni_reap_item reap; +}; + // tcp_listener_funcs looks up function pointers we need for advanced accept // functionality on Windows. Windows is weird. static int @@ -296,7 +310,7 @@ nni_tcp_listener_accept(nni_tcp_listener *l, nni_aio *aio) nni_aio_finish_error(aio, rv); return; } - if ((rv = nni_win_tcp_conn_init(&c, s)) != 0) { + if ((rv = nni_win_tcp_init(&c, s)) != 0) { nni_mtx_unlock(&l->mtx); closesocket(s); nni_aio_finish_error(aio, rv); |
