IClient´T - Narumikazuchi/Networking GitHub Wiki
Assembly: Narumikazuchi.Networking.Sockets.dll
Namespace: Narumikazuchi.Networking.Sockets
Represents the base functionality of a socket client.
public interface IClient<TData>
Connect(System.Net.IPAddress)
Disconnect()
Send(TData)
BufferSize
DataProcessor
Guid
Port
ConnectionClosed
ConnectionEstablished
DataReceived
Connects the IClient<TData>
to the specified IP-Address.
void Connect(System.Net.IPAddress);
Disconnects the IClient<TData>
from it's current connection to an IServer<TData>
.
void Disconnect();
Sends the specified TData
to the connected IServer<TData>
.
void Send(TData);
Gets or sets the size of the System.Byte[]
buffer.
System.Int32 BufferSize { get; set; }
The IClientDataProcessor<TData>
provides the IClient<TData>
with the functionality to process incoming data.
If this property is not set, the IClient<TData>
will instead raise the DataReceived
event every time new data will be received.
IClientDataProcessor<TData>? DataProcessor { get; set; }
Gets the System.Guid
that this IClient<TData>
is assigned to on it's connected IServer<TData>
.
System.Guid Guid { get; }
Gets the port through which the IClient<TData>
is connected.
System.Int32 Port { get; }
Occurs when the connection to an IServer<TData>
has been closed, either client-side or server-side.
EventHandler<IClient<TData>> ConnectionClosed;
Occurs when the connection to an IServer<TData>
has been successfully established.
EventHandler<IClient<<TData>> ConnectionEstablished;
Occurs when the DataProcessor
property is set to null
and the IClient<TData>
receives TData
from it's connected IServer<TData>
.
EventHandler<IClient<TData>, DataReceivedEventArgs<TData>> DataReceived;