internal protected ProcessClient(TcpClient client, ServerPart server) { this.client = client; id = Guid.NewGuid().ToString(); this.server = server; stream = client.GetStream(); string message = GetMessage(); this.color = message.Substring(0, 9); this.nick = message.Substring(9); }
private void startClick(object sender, RoutedEventArgs e) { try { server = new ServerPart(Convert.ToInt32(portBox.Text)); listen = new Thread(new ThreadStart(server.ServerWork)); listen.Start(); this.chatInfo.AppendText("Server waiting for connecting...\r"); } catch (Exception ex) { server.Disconnect(); chatInfo.AppendText(String.Format("Can not start server work. {0}", ex.Message)); } }