Esempio n. 1
0
        public async Task StartServerAsync()
        {
            try
            {
                var Available = CheckPort(ServerOptions.CurrentValue.IPEndPoint.Port);

                if (Available)
                {
                    await UDPServer.StartAsync(CancellationTokenSource.Token);

                    await TCPServer.StartAsync(CancellationTokenSource.Token);

                    MessageBox.Query(40, 7, "Information", "Server Started.", "OK");
                }
                else
                {
                    MessageBox.ErrorQuery(80, 7, "Error", $"Port {ServerOptions.CurrentValue.IPEndPoint.Port} Already Used.", "OK");
                }
            }
            catch (Exception Error)
            {
                MessageBox.ErrorQuery(80, 7, "Error", Error.Message, "OK");
            }
        }
Esempio n. 2
0
        public async Task StartAsync(CancellationToken CancellationToken)
        {
            await UDPServer.StartAsync(CancellationToken);

            await TCPServer.StartAsync(CancellationToken);
        }