Пример #1
0
        /// <summary>
        /// Start or restart the TCPListener.
        /// </summary>
        public void Start()
        {
            Stop();
            try
            {
                fTcpListener = new TcpListener(fIPAddress, fPort);
                fTcpListener.Start();
                fActive = true;
            }
            catch (Exception ex)
            {
                Stop();
                throw ex;
            }

            try
            {
                fTCPListenerThread = new TCPListenerThread(fTcpListener, this);
                fTCPListenerThread.Start();
            }
            catch (Exception ex)
            {
                Stop();
                throw ex;
            }
        }
Пример #2
0
        /// <summary>
        /// Start or restart the TCPListener.
        /// </summary>
        public void Start()
        {
            Stop();
            try
            {
                fTcpListener = new TcpListener(fIPAddress, fPort);
                fTcpListener.Start();
                fActive = true;
            }
            catch (Exception ex)
            {
                Stop();
                throw ex;
            }

            try
            {
                fTCPListenerThread = new TCPListenerThread(fTcpListener,this);
                fTCPListenerThread.Start();
            }
            catch (Exception ex)
            {
                Stop();
                throw ex;
            }
        }