public void AddClient(QuarterClient Client) { Client.Id = ClientCount + ""; ClientCount++; Clients.Add(Client); LatestClient = Client; }
public void RemoveClient(QuarterClient Client) { Clients.Remove(Client); if (Client == LatestClient) { LatestClient = null; } }
public QuarterServer(ServerConfig config) { DefaultAllow = config.DefaultAllow; Flags = config.Flags; Host = config.Host; Port = config.Port; RSACrypto = new RSACrypto(); LatestClient = null; Clients = new List <QuarterClient>(); ClientCount = 1; try { Listener = new TcpListener(Host, Port); Listener.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1); Listener.Start(); } catch (Exception ex) { throw ex; } }