Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var ctx = new InstanceContext(new ChatCallback());
            //var chatClient = new ConsoleModeChatClient.ChatClient.ChatSvcClient(ctx);
            var chatClient = new DuplexChannelFactory <ChatClient.IChat>(ctx, "netTcpBinding.ChatSvc").CreateChannel();
            var name       = args.Count() == 0 ? "Mr Nobody" : args[0];

            chatClient.join(name);
            string what = ReadAndPrompt(name);

            while (what != null)
            {
                chatClient.send(what);
                what = ReadAndPrompt(name);
            }
            chatClient.leave();
        }