public AddonServiceListener(IPAddress ip, int port, IAddonStorage storage)
        {
            this.storage = storage;

            tcpListener = new TcpListener(ip, port);
            tcpListener.Start();

            listenThread = new Thread(new ThreadStart(Listen));
            listenThread.Start();
        }
Exemplo n.º 2
0
        public AddonService(AddonSettings settings, IAddonStorage storage)
        {
            if (!IPAddress.TryParse(settings.ipAddress, out IPAddress ip))
            {
                throw new Exception($"IP Address '{settings.ipAddress}' is not valid");
            }

            Console.WriteLine("Starting AddonService listener on {0}:{1}", ip.ToString(), settings.port);

            listener = new AddonServiceListener(ip, settings, storage);
        }
Exemplo n.º 3
0
        public AddonService(string ipStr, int port, IAddonStorage storage)
        {
            if (!IPAddress.TryParse(ipStr, out IPAddress ip))
            {
                throw new Exception($"IP Address '{ipStr}' is not valid");
            }

            Console.WriteLine("Starting AddonService listener on {0}:{1}", ip.ToString(), port);

            listener = new AddonServiceListener(ip, port, storage);
        }
Exemplo n.º 4
0
        public AddonServiceListener(IPAddress ip, AddonSettings settings, IAddonStorage storage)
        {
            this.settings = settings;
            this.storage  = storage;

            tcpListener = new TcpListener(ip, settings.port);
            tcpListener.Start();

            listenThread = new Thread(new ThreadStart(Listen));
            listenThread.Start();
        }