How To Connect To Diarkis Cloud

This instruction is a walkthrough of how to make a real-time connection with Diarkis Cloud.

Obtaining The Connection EndPoints
Diarkis C# client needs TCP and/or UDP/RUDP endpoints. The endpoints are retrieved by an HTTP REST API of Diarkis Cloud. The HTTP API endpoint is the host address that you created when you deploy a Dairkis Cloud cluster. For more details please read here.
For a production-grade application, you must provide application server(s) independent of Diarkis Cloud to manage your client user data and other application-related data including the authentication of the user.
The HTTP REST API requires a user ID in its request URI to uniquely identify the requesting client. The user ID must be provided by the requesting client.
The HTTP REST API requires the Client Key in its request header. The Client Key is generated when you deploy a Diarkis Cloud cluster.
A successful request will have a response in JSON format similar to the example below:
Call Update Method For Events
Diarkis TCP and UDP/RUDP clients need their Update method to be call every time it needs to dispatch events from network threads that is working in the background.
For Unity Game Engine, you must call in the Unity Update method:
Make A UDP/RUDP Connection
Once you obtained the endpoint, you are now ready to make a connection to Diarkis Cloud. The example below shows how to make a connection with packet encryption keys:
NOTE: UDP does not have “connections” by design, but for the sake of convenience we use the term “connections” here.
How To terminate UDP Connection
The following example is to show how to terminate the UDP connection and its event listener:
Make A TCP Connection
Once you obtained the endpoint, you are now ready to make a connection to Diarkis Cloud. The example below shows how to make a connection with packet encryption keys:
How To terminate TCP Connection
The following example is to show how to terminate the TCP connection and its event listener:
Conclusion
Diarkis client offers secure real-time communications with Diarkis Cloud. It allows the developer to choose the type of real-time communication they need for their applications without changing API the interface.