diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-06-12 20:05:34 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-06-13 18:01:52 -0700 |
| commit | da2aac4a6eb10af88e3938068e24c58aea1832b1 (patch) | |
| tree | fb0676be5426ed1510945b7e7fe3d09eb45333a7 /src/core/socket.h | |
| parent | 61ffae5e3649897776c26799ccaaa35d578ba816 (diff) | |
| download | nng-da2aac4a6eb10af88e3938068e24c58aea1832b1.tar.gz nng-da2aac4a6eb10af88e3938068e24c58aea1832b1.tar.bz2 nng-da2aac4a6eb10af88e3938068e24c58aea1832b1.zip | |
fixes #540 nni_ep_opttype serves no purpose
fixes #538 setopt should have an explicit chkopt routine
fixes #537 Internal TCP API needs better name separation
fixes #524 Option types should be "typed"
This is a rework of the option management code, to make it both clearer
and to prepare for further work to break up endpoints. This reduces
a certain amount of dead or redundant code, and actually saves cycles
when setting options, as some loops were not terminated that should have
been.
Diffstat (limited to 'src/core/socket.h')
| -rw-r--r-- | src/core/socket.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/socket.h b/src/core/socket.h index 833129fa..7c10b195 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -29,12 +29,13 @@ extern void * nni_sock_proto_data(nni_sock *); extern struct nni_proto_pipe_ops *nni_sock_proto_pipe_ops(nni_sock *); extern int nni_sock_setopt( - nni_sock *, const char *, const void *, size_t, int); -extern int nni_sock_getopt(nni_sock *, const char *, void *, size_t *, int); -extern int nni_sock_recvmsg(nni_sock *, nni_msg **, int); -extern int nni_sock_sendmsg(nni_sock *, nni_msg *, int); -extern void nni_sock_send(nni_sock *, nni_aio *); -extern void nni_sock_recv(nni_sock *, nni_aio *); + nni_sock *, const char *, const void *, size_t, nni_opt_type); +extern int nni_sock_getopt( + nni_sock *, const char *, void *, size_t *, nni_opt_type); +extern int nni_sock_recvmsg(nni_sock *, nni_msg **, int); +extern int nni_sock_sendmsg(nni_sock *, nni_msg *, int); +extern void nni_sock_send(nni_sock *, nni_aio *); +extern void nni_sock_recv(nni_sock *, nni_aio *); extern uint32_t nni_sock_id(nni_sock *); // nni_sock_pipe_add adds the pipe to the socket. It is called by @@ -114,9 +115,11 @@ extern void nni_ctx_recv(nni_ctx *, nni_aio *); extern void nni_ctx_send(nni_ctx *, nni_aio *); // nni_ctx_getopt is used to get a context option. -extern int nni_ctx_getopt(nni_ctx *, const char *, void *, size_t *, int); +extern int nni_ctx_getopt( + nni_ctx *, const char *, void *, size_t *, nni_opt_type); // nni_ctx_setopt is used to set a context option. -extern int nni_ctx_setopt(nni_ctx *, const char *, const void *, size_t, int); +extern int nni_ctx_setopt( + nni_ctx *, const char *, const void *, size_t, nni_opt_type); #endif // CORE_SOCKET_H |
