예제 #1
0
        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);
        }
예제 #2
0
 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));
     }
 }