Table of Contents

Class Server

Namespace
QuickLink
Assembly
QuickLink.dll

Represents a server that listens for incoming TCP connections and handles client communication.

public class Server : IDisposable
Inheritance
Server
Implements
Inherited Members

Constructors

Initializes a new instance of the Server class with the specified port and host.

public Server(int port, Host host)

Parameters

port int

The port number on which the server listens for incoming connections.

host Host

The host object that handles received messages.

Fields

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

public EventPublisher<RemoteClient> ClientConnected

Field Value

EventPublisher<RemoteClient>

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

public EventPublisher<RemoteClient> ClientDisconnected

Field Value

EventPublisher<RemoteClient>

Event that is raised when a message is received from a client.

public readonly MessagePublisher MessageReceived

Field Value

MessagePublisher

Methods

Broadcasts a message to all connected clients.

public void BroadcastMessage(MessageWriter message)

Parameters

message MessageWriter

The message to broadcast.

Releases all resources used by the server.

public void Dispose()

Releases the unmanaged resources used by the Server 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 Server class.

protected ~Server()

Receives a message from a client and publishes it to the MessageReceived event.

public void ReceiveMessage(MessageReader message)

Parameters

message MessageReader

The message received from the client.

Starts the server, allowing it to accept incoming client connections.

public void Start()