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(); }
protected virtual void OnStart(EventArgs e) { OnStartListening?.Invoke(); }