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
Server(int, Host)
Initializes a new instance of the Server class with the specified port and host.
public Server(int port, Host host)
Parameters
port
intThe port number on which the server listens for incoming connections.
host
HostThe host object that handles received messages.
Fields
ClientConnected
Event that is raised when a client connects to the server.
public EventPublisher<RemoteClient> ClientConnected
Field Value
ClientDisconnected
Event that is raised when a client disconnects from the server.
public EventPublisher<RemoteClient> ClientDisconnected
Field Value
MessageReceived
Event that is raised when a message is received from a client.
public readonly MessagePublisher MessageReceived
Field Value
Methods
BroadcastMessage(MessageWriter)
Broadcasts a message to all connected clients.
public void BroadcastMessage(MessageWriter message)
Parameters
message
MessageWriterThe message to broadcast.
Dispose()
Releases all resources used by the server.
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the Server object and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)
Parameters
disposing
booltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
~Server()
Finalizes an instance of the Server class.
protected ~Server()
ReceiveMessage(MessageReader)
Receives a message from a client and publishes it to the MessageReceived event.
public void ReceiveMessage(MessageReader message)
Parameters
message
MessageReaderThe message received from the client.
Start()
Starts the server, allowing it to accept incoming client connections.
public void Start()