Class CentralRetransmissionServer
The central retransmission server for the chat system. It handles auth requests and retransmission of messages.
public class CentralRetransmissionServer
- Inheritance
-
CentralRetransmissionServer
- Inherited Members
Constructors
CentralRetransmissionServer(int, int)
Creates a new retranmission server with the specified ports
public CentralRetransmissionServer(int registerPort = 5000, int retransmissionPort = 5001)
Parameters
Properties
AuthenticationService
public ServerService AuthenticationService { get; set; }
Property Value
RetransmissionService
public ServerService RetransmissionService { get; set; }
Property Value
Methods
LoginUserAsync(string, string, string, int)
Async database query to check if a user exists and has the correct password
public Task<bool> LoginUserAsync(string name, string password, string ipAddress, int port)
Parameters
Returns
- Task<bool>
An awaitable task which resolves to true if the user exists and has the correct password, false otherwhise
Exceptions
RegisterUserAsync(string, string, string, int)
public Task RegisterUserAsync(string name, string password, string ipAddress, int port)
Parameters
Returns
Exceptions
Start()
Starts the server with the associated services:
public void Start()
Remarks
The services started are:
StartAuthenticationService()
Sets the AuthenticationService This service is responsible for all authentication operations.
public void StartAuthenticationService()
Remarks
Starts a ServerService in localhost (127.0.0.1)with the specified port AuthenticationPort.
StartRetransmissionService()
Sets the RetransmissionService. This service is responsible for receiving messages from clients and retransmitting them to the all registered users.
public void StartRetransmissionService()
Remarks
Starts a ServerService in localhost (127.0.0.1)with the specified port RetransmissionPort.
Stop()
Stops the services and closes the database connection
public void Stop()