IClient´T - Narumikazuchi/Networking GitHub Wiki

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

Description

Represents the base functionality of a socket client.

public interface IClient<TData>

Implements

Interfaces

IDisposable

Members

Defined

Connect(System.Net.IPAddress)
Disconnect()
Send(TData)
BufferSize
DataProcessor
Guid
Port
ConnectionClosed
ConnectionEstablished
DataReceived

Inherited

IDisposable

Dispose()

Methods

Connect(System.Net.IPAddress)

Connects the IClient<TData> to the specified IP-Address.

void Connect(System.Net.IPAddress);

Disconnect()

Disconnects the IClient<TData> from it's current connection to an IServer<TData>.

void Disconnect();

Send(TData)

Sends the specified TData to the connected IServer<TData>.

void Send(TData);

Properties

BufferSize

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

System.Int32 BufferSize { get; set; }

DataProcessor

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; }

Guid

Gets the System.Guid that this IClient<TData> is assigned to on it's connected IServer<TData>.

System.Guid Guid { get; }

Port

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

System.Int32 Port { get; }

Events

ConnectionClosed

Occurs when the connection to an IServer<TData> has been closed, either client-side or server-side.

EventHandler<IClient<TData>> ConnectionClosed;

ConnectionEstablished

Occurs when the connection to an IServer<TData> has been successfully established.

EventHandler<IClient<<TData>> ConnectionEstablished;

DataReceived

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;
⚠️ **GitHub.com Fallback** ⚠️