Class TCPClient
A Client that uses TCP to communicate
Implements
Inherited Members
Namespace: VoltRpc.Communication.TCP
Assembly: VoltRpc.dll
Syntax
public sealed class TCPClient : Client, IDisposable
Constructors
| Edit this page View SourceTCPClient(IPEndPoint)
Creates a new TCPClient instance
Declaration
public TCPClient(IPEndPoint endPoint)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | endPoint | The IPEndPoint to connect to |
TCPClient(IPEndPoint, int)
Creates a new TCPClient instance
Declaration
public TCPClient(IPEndPoint endPoint, int connectionTimeout)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | endPoint | The IPEndPoint to connect to |
int | connectionTimeout | The timeout time for connection |
TCPClient(IPEndPoint, int, int)
Creates a new TCPClient instance
Declaration
public TCPClient(IPEndPoint endPoint, int receiveTimeout, int sendTimeout)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | endPoint | The IPEndPoint to connect to |
int | receiveTimeout | The receive timeout |
int | sendTimeout | The send timeout |
TCPClient(IPEndPoint, int, int, int, int)
Creates a new TCPClient instance
Declaration
public TCPClient(IPEndPoint endPoint, int bufferSize = 8000, int connectionTimeout = 7000, int receiveTimeout = 600000, int sendTimeout = 600000)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | endPoint | The IPEndPoint to connect to |
int | bufferSize | The size of the buffers |
int | connectionTimeout | The timeout time for connection |
int | receiveTimeout | The receive timeout |
int | sendTimeout | The send timeout |
Fields
| Edit this page View SourceDefaultConnectionTimeout
Default connection timeout time
Declaration
public const int DefaultConnectionTimeout = 7000
Field Value
Type | Description |
---|---|
int |
DefaultReceiveTimeout
Default receive timeout time
Declaration
public const int DefaultReceiveTimeout = 600000
Field Value
Type | Description |
---|---|
int |
DefaultSendTimeout
Default send timeout time
Declaration
public const int DefaultSendTimeout = 600000
Field Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceConnect()
Connects the Client to a host
Declaration
public override void Connect()
Overrides
Exceptions
Type | Condition |
---|---|
TimeoutException | Thrown if a connection timeout occurs |
ConnectionFailedException | Thrown if an unknown error occurs while connecting. |
Dispose()
Destroys the Client instance
Declaration
public override void Dispose()