SmartEngine
1.6.0
|
Singleton server class to manage listening to a port and accept incoming client connections More...
Classes | |
class | ConnectionAcceptedEvent |
class | ConnectionDisconnectEvent |
class | MessageEvent |
class | ServerStartedEvent |
Public Member Functions | |
bool | StartServer (string ipPort) |
Starts the server More... | |
bool | StartServer (ushort port) |
Starts the server, listening to the specified port More... | |
void | StopServer () |
Stops the server More... | |
void | SendMessage (Connection connection, Message message) |
Sends a message to a client. The message is sent asynchronously More... | |
async Task | SendMessageAsync (Connection connection, Message message) |
Awaitable version of SendMessage More... | |
Public Attributes | |
ServerStartedEvent | OnServerStarted |
Invoked when the server starts More... | |
ConnectionAcceptedEvent | OnConnectionAccepted |
Invoked when a client connects More... | |
ConnectionDisconnectEvent | OnConnectionDisconnected |
Invoked when a client disconnects More... | |
MessageEvent | OnMessage |
Invoked when a message from the client is received More... | |
Properties | |
bool | IsStarted [get] |
Returns true if the server is started More... | |
List< Connection > | ClientConnections [get] |
A list of connected clients More... | |
![]() | |
static T | Instance [get] |
Singleton server class to manage listening to a port and accept incoming client connections
void SmartEngine.Networking.Server.SendMessage | ( | Connection | connection, |
Message | message | ||
) |
Sends a message to a client. The message is sent asynchronously
connection | |
message |
async Task SmartEngine.Networking.Server.SendMessageAsync | ( | Connection | connection, |
Message | message | ||
) |
Awaitable version of SendMessage
connection | |
message |
bool SmartEngine.Networking.Server.StartServer | ( | string | ipPort | ) |
Starts the server
ipPort | In the format "[server]:[port]". Only the port is used. |
bool SmartEngine.Networking.Server.StartServer | ( | ushort | port | ) |
Starts the server, listening to the specified port
port |
void SmartEngine.Networking.Server.StopServer | ( | ) |
Stops the server
ConnectionAcceptedEvent SmartEngine.Networking.Server.OnConnectionAccepted |
Invoked when a client connects
ConnectionDisconnectEvent SmartEngine.Networking.Server.OnConnectionDisconnected |
Invoked when a client disconnects
MessageEvent SmartEngine.Networking.Server.OnMessage |
Invoked when a message from the client is received
ServerStartedEvent SmartEngine.Networking.Server.OnServerStarted |
Invoked when the server starts
|
get |
A list of connected clients
|
get |
Returns true if the server is started