LogoLogo
English
English
  • Diarkis Help Center
  • Overview of Diarkis
  • Getting Started
    • Diarkis Server Template
    • Diarkis Client SDK
    • Tutorials
      • 1. Launch Diarkis Server in Local Environment
      • 2. Perform Connectivity Check with Test Client
      • 3. Implement Custom Command
      • Connect to Server from Diarkis Client
    • Samples
  • Diarkis Modules
    • Room Module
      • Set Up Room Module on Server
      • Room Sample
        • room_broadcast
      • Utilizing Room Module from Client
      • Additional Features of Room
    • MatchMaker Module
      • Set Up MatchMaker Module on Server
    • Field Module
      • Set Up Field Module on Server
    • P2P Module
      • Set Up P2P Module on Server
      • P2P Sample
    • DM (Direct Message) Module
      • Set Up DM Module on Server
    • Notifier Module
      • Set Up Notifier Module on Server
    • Session Module
      • Set Up Session Module on Server
    • Group Module
      • Set Up Group Module on Server
  • Diarkis Server
    • Launch Diarkis Server in Cloud Environment
      • AWS
    • Launch Diarkis Server on Windows Environment
    • MARS Server
    • UDP Server
    • TCP Server
    • HTTP Server
    • Metrics API
    • Inter-server Communication - Mesh
  • Diarkis Client
    • Runtime Library
      • Diarkis RUDP
    • Diarkis Module
      • Initialization and Termination of Diarkis Module
      • Customization of Diarkis Module
      • Logging System of Diarkis Module
      • Migration
      • Threads of Diarkis
    • Samples
      • C++
        • room_broadcast
        • directmessage_simple
        • group_sample
        • matching_and_turn
        • matchmaker_ticket
        • p2p_rudp_sample
        • session_simple
      • Unreal Engine Plugin
        • FieldWalker
      • Unity Plugin
        • FieldWalker
          • HowToReplicatePosition.md
  • Diarkis Tools
    • Diarkis CLI
      • Procedures to Switch to Diarkis CLI v3
  • References
    • API Reference
    • Release Notes
      • v1.0
      • v1.0.1
      • v1.0.2
      • v1.0.3
      • v1.0.4
      • v1.0.5
      • v1.0.6
  • Support
    • License and Billing
Powered by GitBook
On this page
  • Overview
  • Main Features
  • Diarkis TCP/UDP/RUDP Communication
  • Thread Management
  • Memory Management and Custom Allocator
  • NAT Type Determination
  • Functions of Each Module
  • Resources Used by the Diarkis Runtime Library
  • Caution

Was this helpful?

  1. Diarkis Client

Runtime Library

Diarkis Client Runtime Library provides the core runtime functionality for real-time communication, event handling, and data synchronization between client applications and the Diarkis server cluster.

Overview

The Diarkis Runtime Library includes core low-level features fundamental to the runtime.

Main Features

  • Basic Functions

    • Diarkis TCP/UDP/RUDP communication

    • Thread management

    • Memory management and custom allocator

    • NAT type determination

  • Functions of each module

Diarkis TCP/UDP/RUDP Communication

The Diarkis Runtime Library supports communication using TCP/UDP/RUDP.

Thread Management

The Diarkis Runtime Library provides Diarkis::DiarkisThread to execute thread operations cross-platform. By using Diarkis::DiarkisThread, you can manipulate threads with the same interface across all supported platforms.

Memory Management and Custom Allocator

In the Diarkis Runtime Library, you can replace the internal memory allocation/deallocation process by setting a custom allocator. Implement your custom allocator by inheriting Diarkis::ICustomAllocator, and set it in the runtime using Diarkis::SetCustomAllocator. An implementation sample code can be found in samples/room_broadcast/main.cpp.

NAT Type Determination

The Diarkis Runtime Library provides functionality for NAT type determination in collaboration with the Diarkis server.

Functions of Each Module

Resources Used by the Diarkis Runtime Library

The Diarkis Runtime Library allocates and uses the following resources internally:

  • Sockets

    • A socket is created for each UDP server connection/TCP server connection.

    • UDP

      • A socket is created within the runtime library when you call DiarkisUdp::Connect(Async) / DiarkisUdp::ConnectDualMode(Async).

      • P2P uses the socket created with UDP.

    • TCP

      • A socket is created within the runtime library when you call DiarkisTcp::Connect / DiarkisTcp::ConnectDualMode.

    • If there are multiple Diarkis servers to connect to, you need to create multiple instances of DiarkisInterfaceBase, which increases the number of sockets accordingly.

  • Threads

    • One thread is created for TCP connections, and two threads for UDP connections.

Caution

  • The APIs of the Diarkis Module are not thread-safe. If using the Diarkis Module in multiple threads, implement exclusive control on the application side.

PreviousDiarkis ClientNextDiarkis RUDP

Last updated 8 days ago

Was this helpful?

For the functionalities of each module, it is recommended to use the . If you wish to use the modules' functions directly from the runtime library, please refer to the .

When using the Diarkis client, threads are also created on the Diarkis Module side. For details, please refer to .

Diarkis Module
C++ API documentation
Diarkis Threads