public async Task TestPush(PitayaSession pitayaSession) { Console.WriteLine("got empty notify"); var msg = Encoding.UTF8.GetBytes("test felipe"); var ok = await pitayaSession.Push(new RPCRes { Code = 200, Msg = "testFelipe" }, "test.route"); if (!ok) { Logger.Error("push to user failed!"); } }
public async Task TestPush(PitayaSession pitayaSession) { Console.WriteLine("got empty notify"); var msg = Encoding.UTF8.GetBytes("test felipe"); try { await pitayaSession.Push(new MyResponse { Code = 200, Msg = "testFelipe" }, "test.route"); } catch (Exception e) { Logger.Error($"push to user failed!: {e}", e); } }