Interface INetworkServer
The network server interface.
Namespace: Evergine.Networking.Connection
Assembly: Evergine.Networking.dll
Syntax
public interface INetworkServer
  Methods
CreateMessage(MessageType)
Creates a new outgoing message.
Declaration
OutgoingMessage CreateMessage(MessageType type = MessageType.Data)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MessageType | type | The type.  | 
      
Returns
| Type | Description | 
|---|---|
| OutgoingMessage | The created outgoing message.  | 
      
Send(IncomingMessage, DeliveryMethod)
Sends the specified incoming message to others clients.
Declaration
void Send(IncomingMessage message, DeliveryMethod deliveryMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IncomingMessage | message | The message.  | 
      
| DeliveryMethod | deliveryMethod | The delivery method.  | 
      
Send(IncomingMessage, DeliveryMethod, NetworkEndpoint)
Sends the specified incoming message to the specified client.
Declaration
void Send(IncomingMessage message, DeliveryMethod deliveryMethod, NetworkEndpoint destinationClient)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IncomingMessage | message | The message.  | 
      
| DeliveryMethod | deliveryMethod | The delivery method.  | 
      
| NetworkEndpoint | destinationClient | The destination client.  | 
      
Send(IncomingMessage, DeliveryMethod, IEnumerable<NetworkEndpoint>)
Sends the specified incoming message to the specified clients.
Declaration
void Send(IncomingMessage message, DeliveryMethod deliveryMethod, IEnumerable<NetworkEndpoint> destinationClients)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IncomingMessage | message | The message.  | 
      
| DeliveryMethod | deliveryMethod | The delivery method.  | 
      
| IEnumerable<NetworkEndpoint> | destinationClients | The destination clients.  | 
      
Send(OutgoingMessage, DeliveryMethod)
Sends the specified outgoing message to all the clients.
Declaration
void Send(OutgoingMessage message, DeliveryMethod deliveryMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| OutgoingMessage | message | The message.  | 
      
| DeliveryMethod | deliveryMethod | The delivery method.  | 
      
Send(OutgoingMessage, DeliveryMethod, NetworkEndpoint)
Sends the specified outgoing message to the specified client.
Declaration
void Send(OutgoingMessage message, DeliveryMethod deliveryMethod, NetworkEndpoint destinationClient)
  Parameters
| Type | Name | Description | 
|---|---|---|
| OutgoingMessage | message | The message.  | 
      
| DeliveryMethod | deliveryMethod | The delivery method.  | 
      
| NetworkEndpoint | destinationClient | The destination client.  | 
      
Send(OutgoingMessage, DeliveryMethod, IEnumerable<NetworkEndpoint>)
Sends the specified outgoing message to the specified clients.
Declaration
void Send(OutgoingMessage message, DeliveryMethod deliveryMethod, IEnumerable<NetworkEndpoint> destinationClients)
  Parameters
| Type | Name | Description | 
|---|---|---|
| OutgoingMessage | message | The message.  | 
      
| DeliveryMethod | deliveryMethod | The delivery method.  | 
      
| IEnumerable<NetworkEndpoint> | destinationClients | The destination clients.  | 
      
ShutdownAsync()
Shutdowns the server.
Declaration
Task ShutdownAsync()
  Returns
| Type | Description | 
|---|---|
| Task | A Task representing the asynchronous operation.  | 
      
StartAsync()
Starts the server.
Declaration
Task StartAsync()
  Returns
| Type | Description | 
|---|---|
| Task | A Task representing the asynchronous operation.  | 
      
Events
ClientConnected
Occurs when the server receives a new client connection.
Declaration
event EventHandler<ClientConnectedEventArgs> ClientConnected
  Event Type
| Type | Description | 
|---|---|
| EventHandler<ClientConnectedEventArgs> | 
Remarks
The incoming message represent the hail message sent by the client.
ClientConnecting
Occurs when the server receives a new client connection request.
Declaration
event EventHandler<ClientConnectingEventArgs> ClientConnecting
  Event Type
| Type | Description | 
|---|---|
| EventHandler<ClientConnectingEventArgs> | 
ClientDisconnected
Occurs when the server lose the connection with a client.
Declaration
event EventHandler<ClientDisconnectedEventArgs> ClientDisconnected
  Event Type
| Type | Description | 
|---|---|
| EventHandler<ClientDisconnectedEventArgs> | 
MessageReceived
Occurs when a message is received by the server.
Declaration
event EventHandler<MessageReceivedEventArgs> MessageReceived
  Event Type
| Type | Description | 
|---|---|
| EventHandler<MessageReceivedEventArgs> |