DCSModulesAPI
1.0.0
DCS sub project containing all the control modules as libraries.
|
Server-side handling features. More...
Enumerations | |
enum | StopMode { StopMode::IMMEDIATE, StopMode::WAIT } |
Dictates how the server thread should stop. More... | |
Functions | |
DCS_API Socket | Create (i32 port) |
Create server listening port. More... | |
DCS_API void | WaitForConnections (Socket server) |
Wait for any client to connect to the server connection Socket. More... | |
DCS_API void | StopListening (Socket server) |
Closes the server listening socket, no longer accepting new connections. More... | |
DCS_API bool | StartThread (Socket client) |
Starts the server thread on a established connection. More... | |
DCS_API void | StopThread (Socket client, StopMode mode=StopMode::IMMEDIATE) |
Stops the server thread on a established connection (Forces disconnect). More... | |
DCS_API Socket | GetConnectedClient () |
Returns the currently server connected client. | |
DCS_API Socket | GetListenSocket () |
Returns the server listen socket. | |
DCS_API bool | IsRunning () |
Checks if the server is running. | |
Server-side handling features.
|
strong |
DCS::Network::Socket DCS::Network::Server::Create | ( | i32 | port | ) |
Create server listening port.
port | Port to bind the server. |
bool DCS::Network::Server::StartThread | ( | Socket | client | ) |
Starts the server thread on a established connection.
client | The connection between server and client returned by WaitForConnection(Socket). |
void DCS::Network::Server::StopListening | ( | Socket | server | ) |
Closes the server listening socket, no longer accepting new connections.
server | Created server socket to perform the operation. |
void DCS::Network::Server::StopThread | ( | Socket | client, |
StopMode | mode = StopMode::IMMEDIATE |
||
) |
Stops the server thread on a established connection (Forces disconnect).
client | The connection between server and client that is currently active. |
mode | How the server thread stops (view StopMode). |
void DCS::Network::Server::WaitForConnections | ( | Socket | server | ) |
Wait for any client to connect to the server connection Socket.
server | Created server socket to wait on. |