예제 #1
0
파일: Program.cs 프로젝트: pkese/Orleankka
        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);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
파일: Program.cs 프로젝트: pkese/Orleankka
        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);
            }
        }
예제 #4
0
        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);
            }
        }