예제 #1
0
 void Listen()
 {
     while(running)
     {
         TcpClient tcpClient = server.AcceptTcpClient();
         client client = new client(this, tcpClient);
         usertracker++;
         Console.WriteLine("Someone is Trying to Connect!");
     }
 }
예제 #2
0
        void showUsers(client client)
        {
            string userString = "";
            client.bw.Write(client.IM_Send);
            client.bw.Write("Server");

                if (CurrentUsers.Count == 0)
                {
                    client.bw.Write("There are no other users connected");
                }
                else
                {
                    for (int i = 0; i < CurrentUsers.Count; i++)
                    {
                        string.Concat(userString, CurrentUsers[i].userName + ", ");
                    }

                    client.bw.Write(userString);
                }
            client.bw.Flush();
        }