From 279180c1d07fc2c4c0bfa8f5a418cb02c4b87863 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 2 Nov 2024 13:57:53 -0700 Subject: 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. --- src/core/protocol.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/core/protocol.h') 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, -- cgit v1.2.3-70-g09d2