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.
最終更新
役に立ちましたか?
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.
The Diarkis Runtime Library includes core low-level features fundamental to the runtime.
Basic Functions
Diarkis TCP/UDP/RUDP communication
Thread management
Memory management and custom allocator
NAT type determination
Functions of each module
The Diarkis Runtime Library supports communication using TCP/UDP/RUDP.
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.
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.
The Diarkis Runtime Library provides functionality for NAT type determination in collaboration with the Diarkis server.
For the functionalities of each module, it is recommended to use the Diarkis Module. If you wish to use the modules' functions directly from the runtime library, please refer to the C++ API documentation.
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.
When using the Diarkis client, threads are also created on the Diarkis Module side. For details, please refer to Diarkis Threads.
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.
最終更新
役に立ちましたか?
役に立ちましたか?

