DCSModulesAPI  1.0.0
DCS sub project containing all the control modules as libraries.
Functions
DCS::Network::Client Namespace Reference

Client-side handling features. More...

Functions

DCS_API Socket Connect (DCS::Utils::String host, i32 port)
 Connect to a running server. More...
 
DCS_API void Authenticate (Socket socket, DCS::Utils::String username, DCS::Utils::String password)
 Authenticates a valid connection. Call after Connect. More...
 
DCS_API bool StartThread (Socket connection)
 Starts the client thread on a established connection. More...
 
DCS_API void StopThread (Socket connection)
 Stops the client thread on a established connection (Forces disconnect). More...
 
DCS_API i16 GetMillisLatency ()
 Gets the current connection latency in milliseconds. More...
 

Detailed Description

Client-side handling features.

Function Documentation

void DCS::Network::Client::Authenticate ( Socket  socket,
DCS::Utils::String  username,
DCS::Utils::String  password 
)

Authenticates a valid connection. Call after Connect.

Parameters
socketThe connection's socket.
usernameUsername.
passwordPassword.
DCS::Network::Socket DCS::Network::Client::Connect ( DCS::Utils::String  host,
i32  port 
)

Connect to a running server.

Parameters
hostServer IPv4 address.
portServer listening port.
Examples:
sockets/simple_client.cpp.
DCS::i16 DCS::Network::Client::GetMillisLatency ( )

Gets the current connection latency in milliseconds.

Todo:
This is not working. Re-enable the tcp keep alive to fix. Possible last check: 10 seconds ago Interval: [0, Inf[ ms
bool DCS::Network::Client::StartThread ( Socket  connection)

Starts the client thread on a established connection.

Parameters
connectionThe connection between server and client returned by Connect(DCS::Utils::String, i32).
Returns
Thread init success.
Examples:
sockets/simple_client.cpp.
void DCS::Network::Client::StopThread ( Socket  connection)

Stops the client thread on a established connection (Forces disconnect).

Parameters
connectionThe connection between server and client that is currently active.
Examples:
sockets/simple_client.cpp.