diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-02 13:57:53 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-02 14:47:50 -0700 |
| commit | 279180c1d07fc2c4c0bfa8f5a418cb02c4b87863 (patch) | |
| tree | b451ac7f845062674d6ab45eb5d530628d3ff47c /src/core/protocol.h | |
| parent | 9b27984d0e2da430b78a975e59f55c96de5f6056 (diff) | |
| download | nng-279180c1d07fc2c4c0bfa8f5a418cb02c4b87863.tar.gz nng-279180c1d07fc2c4c0bfa8f5a418cb02c4b87863.tar.bz2 nng-279180c1d07fc2c4c0bfa8f5a418cb02c4b87863.zip | |
NNG_OPT_RECVFD and NNG_OPT_SENDFD converted to functions.
These options are removed entirely, and their functionality is now
available via special functions, `nng_socket_get_send_poll_fd` and
`nng_socket_get_recv_poll_fd`, making these first class methods on
the socket.
This eliminates a bit of wasteful code, and provides type safety
for these methods.
Diffstat (limited to 'src/core/protocol.h')
| -rw-r--r-- | src/core/protocol.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/protocol.h b/src/core/protocol.h index c7bfb1ad..0d4d12dc 100644 --- a/src/core/protocol.h +++ b/src/core/protocol.h @@ -108,6 +108,12 @@ struct nni_proto_sock_ops { // Receive a message. void (*sock_recv)(void *, nni_aio *); + // Return the receive poll FD. + int (*sock_recv_poll_fd)(void *, int *); + + // Return the send poll FD. + int (*sock_send_poll_fd)(void *, int *); + // Options. Must not be NULL. Final entry should have NULL name. nni_option *sock_options; }; @@ -124,7 +130,7 @@ struct nni_proto { uint32_t proto_flags; // Protocol flags const nni_proto_sock_ops *proto_sock_ops; // Per-socket operations const nni_proto_pipe_ops *proto_pipe_ops; // Per-pipe operations - const nni_proto_ctx_ops * proto_ctx_ops; // Context operations + const nni_proto_ctx_ops *proto_ctx_ops; // Context operations }; // We quite intentionally use a signature where the upper word is nonzero, |
