예제 #1
0
        public void Start(int port = 10000)
        {
            if (!this.IsRunning)
            {
                try
                {
                    this.IsRunning = true;

                    this.TcpListener = new TcpListener(IPAddress.Any, port);
                    this.TcpListener.Start();

                    base.Start();
                    TaskContainer.Run(() => this.Listener(port));
                    base.OnInitializationSuccess("localhost", port);
                }
                catch (Exception e)
                {
                    base.OnInitializationFailed("localhost", port, e);
                    this.Stop();
                }
            }
        }