private static async Task RunChatClient(ClientActorSystem system) { const string room = "Orleankka"; Console.WriteLine("Connecting to server ..."); await system.Connect(retries : 5); Console.WriteLine("Enter your user name..."); var userName = Console.ReadLine(); var client = new ChatClient(system, userName, room); await client.Join(); while (true) { var message = Console.ReadLine(); if (message == "quit") { await client.Leave(); break; } await client.Say(message); } }
static async Task Main(string[] args) { Console.WriteLine("Please wait until Chat Server has completed boot and then press enter."); Console.ReadLine(); Console.WriteLine("Connecting to server ..."); var system = await Connect(retries : 2); Console.WriteLine("Enter your user name..."); var userName = Console.ReadLine(); const string room = "Orleankka"; var client = new ChatClient(system, userName, room); await client.Join(); while (true) { var message = Console.ReadLine(); if (message == "quit") { await client.Leave(); break; } await client.Say(message); } }
static async Task RunChatClient(ClientActorSystem system) { const string room = "Orleankka"; Console.WriteLine("Connecting to server ..."); await system.Connect(retries: 2); Console.WriteLine("Enter your user name..."); var userName = Console.ReadLine(); var client = new ChatClient(system, userName, room); OnClusterConnectionLost += ()=> client.Resubscribe().Wait(); await client.Join(); while (true) { var message = Console.ReadLine(); if (message == "quit") { await client.Leave(); break; } if (message == "reconnect") { await client.Resubscribe(); continue; } await client.Say(message); } }
private static async Task RunChatClient(IActorSystem system) { const string room = "Orleankka"; Console.WriteLine("Enter your user name..."); var userName = Console.ReadLine(); var client = new ChatClient(system, userName, room); await client.Join(); while (true) { var message = Console.ReadLine(); if (message == "quit") { await client.Leave(); break; } await client.Say(message); } }