Home - liuli-neko/NekoProtoTools GitHub Wiki
👋 Welcome! This Wiki is your comprehensive guide to NekoProtoTools, a C++ library designed to make working with network protocols, data serialization, and RPC easier and more efficient.
What is NekoProtoTools?
NekoProtoTools is a pure C++ protocol helper library built to simplify the definition, serialization/deserialization, and RPC communication of messages (protocols) in your C++ applications.
The core idea is to let you focus on your application's logic, not the repetitive and error-prone plumbing of protocol handling. NekoProtoTools provides a robust, testable foundation for these tasks.
Key Features
- ✨ Simple Message Definition: Use standard C++ structs/classes and simple macros (
NEKO_SERIALIZER
,NEKO_DECLARE_PROTOCOL
) to define your messages. - 📦 Versatile Serialization: Out-of-the-box support for JSON (RapidJSON/SIMDJson), a compact Binary format, and XML (deserialization). Easily extendable with custom formats.
- 🔍 Basic Reflection: Access basic metadata like field names at runtime.
- ⚡ Lightweight JSON-RPC 2.0: Implement RPC services with a clean, template-based interface built on Ilias coroutines.
- 🔒 Type Safety: Leverages C++ templates for compile-time checks.
- 🌐 Network Communication: Abstracted communication layer (TCP/UDP) for sending and receiving protocol messages seamlessly using Ilias.
Who is this for?
If you're a C++ developer who needs to:
- Send/receive structured data over a network.
- Save/load application state or configuration in formats like JSON or Binary.
- Implement client-server communication using custom protocols.
- Build RPC services without heavy dependencies.
- Reduce code related to data serialization.
...then NekoProtoTools might be a great fit for you!
Getting Started
Ready to dive in? Here are the first steps:
- ➡️ Installation: Learn how to add NekoProtoTools to your project using xmake.
- 🚀 Tutorial: Basic Serialization: See how easy it is to serialize/deserialize simple C++ data structures.
- 🔧 Tutorial: Defining Protocol Messages: Learn how to define managed protocol messages with reflection support.
- 🌐 Tutorial: Communication Using Protocol Messages: Understand how to use the communication layer to send and receive protocol messages.
- 🛠️ Tutorial: Implementing JSON-RPC Client/Server: Learn how to implement JSON-RPC services using NekoProtoTools.
Explore the Concepts
Understand the building blocks of NekoProtoTools:
- 📖 Core Concepts: Learn about Serializers, Protocol Management, the Communication Layer, and JSON-RPC.
- 📋 Supported Types: See the full list of C++ types supported by the built-in serializers.
- 🛠️ Advanced Topics: Go deeper with custom serializers, performance tips, and more.
Need Help or Want to Contribute?
- ❓ Found an issue or have a question? Please open an issue on GitHub.
- 🤝 Want to contribute? Check out the Contributing Guidelines. We welcome your help!
License
NekoProtoTools is licensed under the GPL-2.0 License.