How crazyfull/netrector works
netRector is a Linux epoll-based asynchronous networking library. Applications configure a Server and accept factory or create outbound sockets; per-shard reactors dispatch TCP and UDP events, while TCP can resolve hostnames asynchronously and optionally negotiate TLS. The library also provides timers and a Yamux multiplexed tunnel. Internal support includes socket registration, send queues, and buffer pooling. The README documents the principal APIs and ownership model; some subsystem links below are omitted where the sampled excerpts do not show the runtime call.
Main entry points: clsEpollReactor.cpp Epoll reactor · clsTCPSocket.cpp TCP sockets · clsServer.cpp Server · clsUDPSocket.cpp UDP sockets
Components 13
Reactor runtime
- Server
src/clsServer.cpp - Epoll reactor
src/clsEpollReactor.cpp - TCP listeners
src/clsListener.cpp
Network transports
- TCP sockets
src/clsTCPSocket.cpp - UDP sockets
src/clsUDPSocket.cpp
Connection services
- Async DNS
src/clsDNSLookup.cpp - TLS context
src/clsTLSContext.cpp - Yamux tunnel
src/clsMultiplexedTunnel.cpp - Timer manager
src/clsTimerManager.cpp
Runtime support
- Socket registry
src/clsSocketList.cpp - Send queue
src/clsSendQueue.cpp - Buffer pool
src/clsBufferPool.cpp
Other components
- Application
Connections 14
- Application → Server: starts server
README.md - Application → TCP sockets: creates sockets
README.md - Application → UDP sockets: uses datagrams
README.md - Server → Epoll reactor: owns shards
README.md - Epoll reactor → TCP listeners: accepts connections
src/clsEpollReactor.cpp - Epoll reactor → TCP sockets: dispatches events
src/clsEpollReactor.cpp - Epoll reactor → UDP sockets: dispatches events
src/clsEpollReactor.cpp - TCP sockets → Async DNS: resolves hosts
README.md - TCP sockets → TLS context: enables TLS
README.md - Epoll reactor → Timer manager: runs timers
README.md - Epoll reactor → Socket registry: registers sockets
src/clsEpollReactor.cpp - TCP sockets → Send queue: queues writes
- Epoll reactor → Buffer pool: owns buffers
README.md - TCP sockets → Yamux tunnel: carries multiplexing