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:

  1. ➡️ Installation: Learn how to add NekoProtoTools to your project using xmake.
  2. 🚀 Tutorial: Basic Serialization: See how easy it is to serialize/deserialize simple C++ data structures.
  3. 🔧 Tutorial: Defining Protocol Messages: Learn how to define managed protocol messages with reflection support.
  4. 🌐 Tutorial: Communication Using Protocol Messages: Understand how to use the communication layer to send and receive protocol messages.
  5. 🛠️ 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?

License

NekoProtoTools is licensed under the GPL-2.0 License.