Exemple #1
0
        static void Main(string[] args)
        {
            //IConfigurationProvider configuration = new JsonConfigurationProvider(new JsonConfigurationSource {//todo move to new class
            //	Path = Environment.CurrentDirectory + "app.json",
            //	ReloadOnChange = true
            //});
            //configuration.Load();
            IPAddress ipAddress = IPAddress.Any;
            //if (configuration.TryGet("ip_address", out var address)) {
            //	ipAddress = IPAddress.Parse(address);
            //}
            var port = 9973;
            //if (configuration.TryGet("port", out var portStr)) {
            //	port = int.Parse(portStr);
            //}
            var server = new TCP.Server();

            try {
                server.Listen(ipAddress, port);
                System.Console.ReadLine();
                server.Disconnect();
            } catch (Exception e) {
                server.Disconnect();
                System.Console.WriteLine(e);
                throw;
            }
        }