public static void Run() { var chatClient = new ChatClient(); //var subscription = CreateObservableConnection(chatClient); //var subscription = CreateObservableConnectionFluenttly(chatClient); var subscription = CreateDefferedObservableConnection(chatClient); while (true) { Console.WriteLine("write a message to be sent, E for error, or X to exit"); var msg = Console.ReadLine(); if (msg == "X") { chatClient.NotifyClosed(); break; } if (msg == "E") { chatClient.NotifyError(); } chatClient.NotifyRecieved(msg); } }
public static void Run() { var chatClient = new ChatClient(); //var subscription = CreateObservableConnection(chatClient); //var subscription = CreateObservableConnectionFluenttly(chatClient); var subscription = CreateDefferedObservableConnection(chatClient); while (true) { Console.WriteLine("write a message to be sent, E for error, or X to exit"); var msg = Console.ReadLine(); if (msg == "X") { chatClient.NotifyClosed(); break; } if (msg == "E") { chatClient.NotifyError(); } chatClient.NotifyRecieved(msg); } }