Show / Hide Table of Contents

Class ClientTcp

A TCP client building on the Client class.

Inheritance
System.Object
Client
ClientTcp
Implements
System.IDisposable
Inherited Members
Client.ipAddress
Client.port
Client.IpAddress
Client.Port
Client.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: IMLD.MixedRealityAnalysis.Network
Assembly: Assembly-CSharp.dll
Syntax
public class ClientTcp : Client, IDisposable

Constructors

ClientTcp(String, Int32)

Initializes a new instance of the ClientTcp class.

Declaration
public ClientTcp(string ipAddress, int port)
Parameters
Type Name Description
System.String ipAddress

The if address of the server, to which the client should connect.

System.Int32 port

The port of the server, to which the client should connect.

Properties

IsOpen

Gets a value indicating whether the client is connected to a server.

Declaration
public override bool IsOpen { get; }
Property Value
Type Description
System.Boolean
Overrides
Client.IsOpen

Methods

Close()

Terminate the connection to the server and free all used resources.

Declaration
public override void Close()
Overrides
Client.Close()

Open()

Tries to open the connection to the server. Note: If the method return true, this doesn't mean the connection itself was successful, only that the attempt has been started. Subscribe to the Connected event to be notified if the connection to the server has been successfully established.

Declaration
public override bool Open()
Returns
Type Description
System.Boolean

true if the connection attempt has been successfully started, otherwise false.

Overrides
Client.Open()

Send(Byte[])

Send the specified data to the server. Only works then the client is connected.

Declaration
public override bool Send(byte[] data)
Parameters
Type Name Description
System.Byte[] data

The data that should be send.

Returns
Type Description
System.Boolean

true if the data has been send, otherwise false.

Overrides
Client.Send(Byte[])

Events

Connected

Called when the client successfully connected to a server.

Declaration
public event EventHandler Connected
Event Type
Type Description
System.EventHandler

DataReceived

Called when the client successfully received data from the server.

Declaration
public event ByteDataHandler DataReceived
Event Type
Type Description
ByteDataHandler

Implements

System.IDisposable
In This Article
Back to top Generated by DocFX