diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-12-29 21:28:49 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-12-31 17:10:04 -0800 |
| commit | a73ff5363eae228009413872b05aff758a46c5ca (patch) | |
| tree | d5fa805188f915fc94c9b80d4f5cbbb96e6a4551 /src/platform/windows/win_tcp.h | |
| parent | e0fff1f9c45f5486fc2e7eeb49b4462c3bb2dad4 (diff) | |
| download | nng-a73ff5363eae228009413872b05aff758a46c5ca.tar.gz nng-a73ff5363eae228009413872b05aff758a46c5ca.tar.bz2 nng-a73ff5363eae228009413872b05aff758a46c5ca.zip | |
fixes #825 TCP public API should use generic setopt/getopt
This changes much of the internal API for TCP option handling, and
includes hooks for some of this in various consumers. Note that the
consumers still need to have additional work done to complete them,
which will be part of providing public "raw" TLS and WebSocket APIs.
We would also like to finish addressing the call sites of
nni_tcp_listener_start() that assume the sockaddr is modified --
it would be superior to use the NNG_OPT_LOCADDR option. Thaat will be
addressed in a follow up PR.
Diffstat (limited to 'src/platform/windows/win_tcp.h')
| -rw-r--r-- | src/platform/windows/win_tcp.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/platform/windows/win_tcp.h b/src/platform/windows/win_tcp.h index 9c7a4d0e..96854ac1 100644 --- a/src/platform/windows/win_tcp.h +++ b/src/platform/windows/win_tcp.h @@ -1,6 +1,7 @@ // // Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> +// Copyright 2018 Devolutions <info@devolutions.net> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -15,7 +16,7 @@ #include "core/nng_impl.h" -#ifdef NNG_PLATFORM_WINDOWS +#include <nng/transport/tcp/tcp.h> struct nni_tcp_conn { SOCKET s; @@ -42,6 +43,8 @@ struct nni_tcp_dialer { LPFN_CONNECTEX connectex; // looked up name via ioctl nni_list aios; // in flight connections bool closed; + bool nodelay; // initial value for child conns + bool keepalive; // initial value for child conns SOCKADDR_STORAGE src; size_t srclen; nni_mtx mtx; @@ -53,6 +56,8 @@ struct nni_tcp_listener { 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; @@ -60,10 +65,6 @@ struct nni_tcp_listener { nni_reap_item reap; }; -extern int nni_win_tcp_conn_init(nni_tcp_conn **, SOCKET); -extern void nni_win_tcp_conn_set_addrs( - nni_tcp_conn *, const SOCKADDR_STORAGE *, const SOCKADDR_STORAGE *); - -#endif // NNG_PLATFORM_WINDOWS +extern int nni_win_tcp_conn_init(nni_tcp_conn **, SOCKET); #endif // NNG_PLATFORM_WIN_WINTCP_H |
