IServer´T - Narumikazuchi/Networking GitHub Wiki

Assembly: Narumikazuchi.Networking.Sockets.dll
Namespace: Narumikazuchi.Networking.Sockets

Description

Represents the base functionality of a socket server.

public interface IServer<TData>

Implements

Interfaces

IDisposable

Members

Defined

Broadcast(TData)
Disconnect(in System.Guid)
Send(TData, in System.Guid)
Start()
Stop()
AcceptCondition
BufferSize
Clients
DataProcessor
Port
ClientConnected
ClientDisconnected
DataReceived

Inherited

IDisposable

Dispose()

Methods

Broadcast(TData)

Sends the specified TData to the all connected IClient<TData> objects.

void Broadcast(TData);

Disconnect(in System.Guid)

Disconnects the IClient<TData> who is associated with the specified System.Guid.

void Disconnect(in System.Guid);

Send(TData, in System.Guid)

Sends the specified TData to the IClient<TData> associated with the specified System.Guid.

void Send(TData, 
          in System.Guid);

Start()

Starts the IServer<TData> and enables IClient<TData> objects to connect to it.

void Start();

Stop()

Stops the IServer<TData> and closes the connection to all connected IClient<TData> objects.

void Stop();

Properties

AcceptCondition

Gets or sets the condition for a new IClient<TData> connection to be accepted.

System.Func<System.Boolean> AcceptCondition { get; set; }

BufferSize

Gets or sets the size of the System.Byte[] buffer.

System.Int32 BufferSize { get; set; }

Clients

Gets all associated System.Guid for the currently connected IClient<TData> objects.

System.Collections.Generic.IReadOnlyList<System.Guid> Clients { get; }

DataProcessor

Gets or sets the IServerDataProcessor<TData> for this IServer<TData>.

IServerDataProcessor<TData>? DataProcessor { get; set; }

Port

Gets the port through which the IServer<TData> is connected.

System.Int32 Port { get; }

Events

ClientConnected

Occurs when a new IClient<TData> connected with the IServer<TData>.

EventHandler<IServer<TData>, ConnectionEventArgs> ClientConnected;

ClientDisconnected

Occurs when an IClient<TData> has been disconnected from the IServer<TData>, either through Disconnect(in System.Guid) or from the client-side.

EventHandler<IServer<TData>, ConnectionEventArgs> ClientDisconnected;

DataReceived

Occurs when the DataProcessor property is set to null and the IServer<TData> receives TData from one of it's connected IClient<TData> objects.

EventHandler<IServer<TData>, DataReceivedEventArgs<TData>> DataReceived;
⚠️ **GitHub.com Fallback** ⚠️