-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the MoonNet wiki!
MoonNet is a lightweight, high-performance, event-driven network library based on C++. It aims to simplify the development of network applications, supporting both TCP and UDP protocols. It provides an efficient event loop mechanism for handling asynchronous I/O operations. With its modular design, MoonNet offers flexible interfaces that allow developers to quickly build high-performance network services.
The core modules of MoonNet include:
-
Event Loop (
eventloop): Manages the registration, deletion, and distribution of events, implementing the core Reactor model. -
Event (
event): Represents an event on a file descriptor, encapsulating event callbacks and trigger mechanisms. -
Buffer (
buffer): Handles data buffering for non-blocking I/O, implementing data caching and processing. -
Buffered Event (
bfevent): A buffer-based event handling class, encapsulating read/write buffers and callbacks. -
UDP Event (
udpevent): Handles the sending and receiving of UDP packets. -
Timer Event (
timerevent): Provides timer functionality, supporting one-time and periodic timers. -
Signal Event (
signalevent): Handles UNIX signals, integrating signal events into the event loop. -
Acceptor (
acceptor): Listens on TCP ports and accepts new connections. -
Server (
server): Encapsulates TCP and UDP server functionalities, managing connections, events, and thread pools. -
Thread Pool (
threadpool): Implement a simple thread pool with either static or dynamic modes, providing straightforward and easy-to-use interface functions. -
Lock-Free Ring Buffer (
ringbuff): Implements a lock-free circular buffer, providing simple and easy-to-use interface functions. -
Lock-Free Task Thread (
lfthread): Encapsulatesringbuffas a task queue and a thread into the lfthread class, facilitating management. -
Lock-Free Thread Pool (
lfthreadpool): Based on an architecture where each thread has oneringbuffas a task queue (encapsulated aslfthread), this implements a lock-free thread pool. It provides static or dynamic modes, features dynamic backing-off strategies for thread sleeping adjustments, and includes a rejection strategy when the task queue is full.
Note: The commented-out section labeled
/** v1.0.0 **/contains deprecated or previous versions of event handling functions. These have been superseded by the generalized functions to provide a unified approach to event management.
MoonNet provides an efficient and easy-to-use network programming framework suitable for building various types of network applications. With its modular design and flexible interfaces, developers can quickly implement high-performance network services. We hope this documentation helps you better understand and use the MoonNet network library.
If you have any questions or suggestions, feel free to contact the author or submit feedback.