示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Console Chat Application\nPlease enter a login alias to continue");
            LoginName = Console.ReadLine();
            using (var client = new RedisClient())
            {
                client.PublishMessage(ChannelName, LoginName + " has joined the channel");
            }
            var listener = new ThreadController();
            var chatThreadControllerListener = new ChatThreadController(listener);
            var chatThreadControllerSender   = new ChatThreadController(listener);

            var listenerThread = new Thread(chatThreadControllerListener.Listen);
            var senderThread   = new Thread(chatThreadControllerListener.Send);

            listenerThread.Start();
            senderThread.Start();
        }
示例#2
0
 public ChatThreadController(ThreadController thread)
 {
     _chatThread = thread;
 }