Ejemplo n.º 1
0
        private void StartListening()
        {
            try
            {
                listener = new TcpListenerEx(localEndPoint);
                listener.Start();
                Runner.Primary(() => OnStartListening.Invoke());

                // An incoming connection needs to be processed.
                client = listener.AcceptTcpClient();
                client.ReceiveBufferSize = Int32.MaxValue;
                networkStream            = client.GetStream();

                AcceptConnection();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString() + "Line 79");
            }


            Console.WriteLine("\nPress ENTER to continue...");
            //Console.Read();
        }
Ejemplo n.º 2
0
 protected virtual void OnStart(EventArgs e)
 {
     OnStartListening?.Invoke();
 }