Class EasyHost

Listens for incoming EasyClient connections

Namespace: EasyCommunication.Host.Connection

Assembly: EasyCommunication.dll

Syntax

Constructors

EasyHost(Int32, Int32, IPAddress)

Creates an instance of EasyHost with a Heartbeat Interval, a Listening Port and a Listening Address.

Declaration

public EasyHost(int heartbeatInterval, int listeningPort, IPAddress listeningAddress)

Parameters

Type

Name

Description

System.Int32

heartbeatInterval

Heartbeat Interval

System.Int32

listeningPort

System.Net.IPAddress

listeningAddress

Listening Address for TcpListener

Properties

ClientConnections

All Connections with received Heartbeats since last query, used by EasyCommunication.Host.Connection.Heartbeat.

Declaration

public Dictionary<TcpClient, int> ClientConnections { get; }

Property Value

Type

Description

System.Collections.Generic.Dictionary<System.Net.Sockets.TcpClient, System.Int32>

EventHandler

EventHandler for EasyHost-events

Declaration

public HostEventHandler EventHandler { get; }

Property Value

Type

Description

HostEventHandler

ListeningPort

The port on which the Host is listening for incoming connections

Declaration

public int ListeningPort { get; }

Property Value

Type

Description

System.Int32

TcpListener

The TcpListener used to listen for incoming connections.

Declaration

public TcpListener TcpListener { get; }

Property Value

Type

Description

System.Net.Sockets.TcpListener

Methods

Close()

Closes the TcpListener from listening for connections

Declaration

Open()

Open the TcpListener to listen for connections

Declaration

SendData<T>(T, TcpClient)

Sends data to the specified receiver

Declaration

public SendStatus SendData<T>(T data, TcpClient receiver)

Parameters

Type

Name

Description

T

data

Data to send

System.Net.Sockets.TcpClient

receiver

Receiver of the data

Returns

Type

Description

Type Parameters

Name

Description

T

Custom Type which has to be either JsonConvert'able or Serializable

Last updated

Was this helpful?