Example #1
0
        public static async Task Test(Channel channel)
        {
            var manager = await ClientConnectionLifetimeManager.Connect(channel);

            manager.RegisterDisconnectAction(() =>
            {
                Console.WriteLine("disconnected!");
            });

            await MagicOnionClient.Create <IHeartbeat>(channel).TestSend(manager.ConnectionId);
        }
Example #2
0
        public static async Task Run(Channel channel)
        {
            var heartbeat = await ClientConnectionLifetimeManager.Connect(channel);

            var client = MagicOnionClient.Create <IChatRoomService>(channel)
                         .WithHeaders(heartbeat.ToMetadata());


            var room = await await client.CreateNewRoom("room", "hogehoge");

            new ChatRoomStreaming(client).SubscribeAll();


            await await client.SendMessage(room.Id, "hogehogehogehoge");
        }