public override Task OnActivateAsync() { Task task = base.OnActivateAsync(); CallAsync.AddRpcHandlers <ISHelloService>(new SHelloService(this)); return(task); }
public MyTask <(int, int)> HelloInt(int a) { Logger.Debug($"server: recv helloint {a}"); MyTask.Run(async delegate(object o) { var(c, d) = await CallAsync.GetRpc <ICHelloService>().HelloInt(1); Logger.Debug($"recv client a: {c}, b: {d}"); }, null); return(MyTask.FromResult((a, a))); }
public override Task OnActivateAsync() { Logger.Info($"OnActivateAsync, session {IdentityString}"); CallAsync = new CallAsync(this); //this.RegisterTimer(async delegate (object o) //{ // if (Console.KeyAvailable) // { // if (Console.ReadKey().Key == ConsoleKey.Spacebar) // { // m_CHelloService.Hello(); // var (a,b) = await m_CHelloService.HelloInt(1); // CoolLog.WriteLine($"recv client a: {a}, b: {b}"); // } // } //}, null, new TimeSpan(0), new TimeSpan(0,0,0,0,100)); return(Task.CompletedTask); }
public void Hello() { Logger.Debug("server: recv hello"); CallAsync.GetRpc <ICHelloService>().Hello(); }