IServer´T - Narumikazuchi/Networking GitHub Wiki
Assembly: Narumikazuchi.Networking.Sockets.dll
Namespace: Narumikazuchi.Networking.Sockets
Represents the base functionality of a socket server.
public interface IServer<TData>
Broadcast(TData)
Disconnect(in System.Guid)
Send(TData, in System.Guid)
Start()
Stop()
AcceptCondition
BufferSize
Clients
DataProcessor
Port
ClientConnected
ClientDisconnected
DataReceived
Sends the specified TData
to the all connected IClient<TData>
objects.
void Broadcast(TData);
Disconnects the IClient<TData>
who is associated with the specified System.Guid
.
void Disconnect(in System.Guid);
Sends the specified TData
to the IClient<TData>
associated with the specified System.Guid
.
void Send(TData,
in System.Guid);
Starts the IServer<TData>
and enables IClient<TData>
objects to connect to it.
void Start();
Stops the IServer<TData>
and closes the connection to all connected IClient<TData>
objects.
void Stop();
Gets or sets the condition for a new IClient<TData>
connection to be accepted.
System.Func<System.Boolean> AcceptCondition { get; set; }
Gets or sets the size of the System.Byte[]
buffer.
System.Int32 BufferSize { get; set; }
Gets all associated System.Guid
for the currently connected IClient<TData>
objects.
System.Collections.Generic.IReadOnlyList<System.Guid> Clients { get; }
Gets or sets the IServerDataProcessor<TData>
for this IServer<TData>
.
IServerDataProcessor<TData>? DataProcessor { get; set; }
Gets the port through which the IServer<TData>
is connected.
System.Int32 Port { get; }
Occurs when a new IClient<TData>
connected with the IServer<TData>
.
EventHandler<IServer<TData>, ConnectionEventArgs> ClientConnected;
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;
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;