Table of Contents

Class Client

Namespace
QuickLink
Assembly
QuickLink.dll

Represents a client that connects to a server using TCP/IP.

public class Client : IClient, IDisposable
Inheritance
Client
Implements
Inherited Members

Fields

Event that is raised when the client successfully connects to the server.

public EventPublisher Connected

Field Value

EventPublisher

Current state of the client's TCP connection.

public ConnectionState ConnectionState

Field Value

ConnectionState

Event that is raised when the client disconnects from the server.

public EventPublisher Disconnected

Field Value

EventPublisher

Properties

Event that is raised when a message is received from the server.

public MessagePublisher MessageReceived { get; }

Property Value

MessagePublisher

Methods

Connects the client to the specified host and port.

public Task Connect(string host, int port)

Parameters

host string

The host name or IP address of the server.

port int

The port number to connect to.

Returns

Task

Exceptions

ArgumentNullException
ArgumentOutOfRangeException
SocketException
ObjectDisposedException

Releases the resources used by the Client object.

public void Dispose()

Releases the unmanaged resources used by the Client object and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Finalizes an instance of the Client class.

protected ~Client()

Sends a message to the server.

public void SendToServer(MessageWriter message)

Parameters

message MessageWriter

The message to send.

Exceptions

ObjectDisposedException
SemaphoreFullException