Class ClientTcp
A TCP client building on the Client class.
Implements
Inherited Members
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
Methods
Close()
Terminate the connection to the server and free all used resources.
Declaration
public override void Close()
Overrides
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
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
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 |