/// <summary> /// 接收消息 /// </summary> /// <returns></returns> static async Task RejectMessage() { var receiver = new PushHubReceiver(); receiver.Start(); await receiver.ConnectionAsync("002", false); }
static async Task WriteMessage() { var receiver = new PushHubReceiver(); receiver.Start(); await receiver.ConnectionAsync("001", true); bool exit = false; while (!exit) { switch (Console.ReadLine()) { case "1": await receiver.SendEventAsync("001,002,003,004,005", EventType.Common); break; case "2": await receiver.SendEventAsync("a,b,c,d,e,f,g", EventType.Queue); break; case "3": exit = true; break; } } await receiver.DisconnectionAsync(); }