public TCPServer(ChatUtils.Console console) { this.console = console; try { this.tcpListener = new TcpListener(IPAddress.Any, 3000); this.listenThread = new Thread(new ThreadStart(ListenForClients)); this.listenThread.Start(); allConnections = new List <NetworkStream>(); } catch (Exception e) { console.writeLine(e.ToString()); } }
public TCPClient(string p1, int p2, ChatUtils.Console console) { try { client = new TcpClient(); serverEndPoint = new IPEndPoint(IPAddress.Parse(p1), p2); client.Connect(serverEndPoint); clientStream = client.GetStream(); timer = new System.Timers.Timer(); timer.Interval = 100; timer.Elapsed += new ElapsedEventHandler(timerElapsed); timer.Start(); this.console = console; } catch (Exception e) { this.console = console; console.writeLine(e.ToString()); } }
public LocalCommandHandler(ChatUtils.Console console) { this.console = console; }