How To Make A Connection Using Diarkis UDP Client

Diarkis UDP Client Manages UDP/RUDP Communications With The Server.

How To Retrieve Server Endpoint and Encryption Keys

Diarkis UDP Client needs to have server endpoint and encryption keys to establish a connection with the server.

To obtain the endpoint and encryption keys, you must call Diarkis HTTP API.

Diarkis does not have any form of user authentication. This is because Diarkis itself does not manage user data.

The application must first authenticate the user client using its own authentication method, then the application server must make an API call to Diarkis HTTP server to obtain the endpoint and encryption keys for the client. This part should be done server-to-server communication.

Establishing A New Connection To The Server

// sendInterval controls the interval sending messages in milliseconds
int sendInterval = 100;

Diarkis.Udp diarkisUdpClient = new Diarkis.Udp(sendInterval);

diarkisUdpClient.OnConnect += HandleDiarkisUdpClientOnConnect;

diarkisUdpClient.SetEncryptionKeys(encryptionSid, encryptionKey, encryptionIv, encryptionMacKey);

diarkisUdpClient.Connect(endpointAddress, endpointPort);