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/posix/posix_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/posix/posix_tcp.h')
| -rw-r--r-- | src/platform/posix/posix_tcp.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/platform/posix/posix_tcp.h b/src/platform/posix/posix_tcp.h index 633a63b5..788fcbf8 100644 --- a/src/platform/posix/posix_tcp.h +++ b/src/platform/posix/posix_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 @@ -10,7 +11,6 @@ #include "core/nng_impl.h" -#ifdef NNG_PLATFORM_POSIX #include "platform/posix/posix_aio.h" struct nni_tcp_conn { @@ -27,6 +27,8 @@ struct nni_tcp_conn { struct nni_tcp_dialer { nni_list connq; // pending connections bool closed; + bool nodelay; + bool keepalive; struct sockaddr_storage src; size_t srclen; nni_mtx mtx; @@ -37,10 +39,10 @@ struct nni_tcp_listener { nni_list acceptq; bool started; bool closed; + bool nodelay; + bool keepalive; nni_mtx mtx; }; extern int nni_posix_tcp_conn_init(nni_tcp_conn **, nni_posix_pfd *); -extern void nni_posix_tcp_conn_start(nni_tcp_conn *); - -#endif // NNG_PLATFORM_POSIX +extern void nni_posix_tcp_conn_start(nni_tcp_conn *, int, int); |
