Skip to content

Commit 893a5dc

Browse files
committed
Consolidate reactor backends into parameterized templates
The epoll, kqueue, and select backends each had 13 nearly-identical per-protocol files for the socket, service, and acceptor types of TCP, UDP, and Unix stream/datagram. Replace those 39 files with shared parameterized templates plus per-backend traits and types files, dropping each backend from 14 files (the 13 plus the scheduler) to 3 (scheduler, traits, types). New per-backend files: - {backend}_traits.hpp: platform-specific behavior (socket creation flags, write and accept policies, fd configuration, stream socket hook for SO_LINGER, descriptor_state) - {backend}_types.hpp: named final classes that instantiate the shared templates New shared templates in detail/reactor/: - reactor_stream_ops.hpp and reactor_datagram_ops.hpp: parameterized op types - reactor_socket_finals.hpp: reactor_stream_socket_impl, reactor_dgram_socket_impl, reactor_acceptor_impl - reactor_service_finals.hpp: per-protocol service implementations plus do_open_socket, do_assign_fd, and do_open_acceptor helpers - reactor_backend.hpp: the accept() method body, which needs all the named types to be complete The existing reactor base templates (reactor_basic_socket, reactor_stream_socket, reactor_datagram_socket, reactor_acceptor) gain ImplBase and Endpoint template parameters so a single template works for both IP and Unix domain sockets. io_context.cpp and the native/ tcp_socket, tcp_acceptor, and udp_socket headers switch to including {backend}_types.hpp in place of the individual service headers.
1 parent b864679 commit 893a5dc

File tree

64 files changed

+2617
-7980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2617
-7980
lines changed

include/boost/corosio/native/detail/epoll/epoll_local_datagram_service.hpp

Lines changed: 0 additions & 303 deletions
This file was deleted.

0 commit comments

Comments
 (0)