aboutsummaryrefslogtreecommitdiff
path: root/src/platform/windows/win_tcp.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-28 13:53:18 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-28 13:53:24 -0800
commit7b5515ca641f475dce8184a5d9fd67ceb860e843 (patch)
treedd6e458ea87df33b3d9b359572abdd63154c6999 /src/platform/windows/win_tcp.h
parent146e10d365e3c451ba92b226e0d7cbfcc3574383 (diff)
downloadnng-7b5515ca641f475dce8184a5d9fd67ceb860e843.tar.gz
nng-7b5515ca641f475dce8184a5d9fd67ceb860e843.tar.bz2
nng-7b5515ca641f475dce8184a5d9fd67ceb860e843.zip
tcp: flatten the listener implementation
The endpoints both use a nesting level for some common code and some platform dependent code. But the common code isn't that much and we have similar patterns for e.g. IPC. This avoids a layer of indirection in the structs, and extra allocations. The payoff will be even larger for the dialers, but that is next. (Dialers are more complicated because of DNS.)
Diffstat (limited to 'src/platform/windows/win_tcp.h')
-rw-r--r--src/platform/windows/win_tcp.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/platform/windows/win_tcp.h b/src/platform/windows/win_tcp.h
index d151b9a3..655a969c 100644
--- a/src/platform/windows/win_tcp.h
+++ b/src/platform/windows/win_tcp.h
@@ -17,27 +17,27 @@
#include "core/nng_impl.h"
struct nni_tcp_conn {
- nng_stream ops;
- SOCKET s;
- nni_win_io recv_io;
- nni_win_io send_io;
- nni_win_io conn_io;
- nni_list recv_aios;
- nni_list send_aios;
- nni_aio *conn_aio;
- SOCKADDR_STORAGE sockname;
- SOCKADDR_STORAGE peername;
- nni_tcp_dialer *dialer;
- nni_tcp_listener *listener;
- int recv_rv;
- int send_rv;
- int conn_rv;
- bool closed;
- char buf[512]; // to hold acceptex results
- bool sending;
- bool recving;
- nni_mtx mtx;
- nni_cv cv;
+ nng_stream ops;
+ SOCKET s;
+ nni_win_io recv_io;
+ nni_win_io send_io;
+ nni_win_io conn_io;
+ nni_list recv_aios;
+ nni_list send_aios;
+ nni_aio *conn_aio;
+ SOCKADDR_STORAGE sockname;
+ SOCKADDR_STORAGE peername;
+ nni_tcp_dialer *dialer;
+ void *listener;
+ int recv_rv;
+ int send_rv;
+ int conn_rv;
+ bool closed;
+ char buf[512]; // to hold acceptex results
+ bool sending;
+ bool recving;
+ nni_mtx mtx;
+ nni_cv cv;
};
extern int nni_win_tcp_init(nni_tcp_conn **, SOCKET);