public async void OnBar(Session session, BarPacket packet) { //Console.WriteLine(SynchronizationContext.Current == null); //Thread.CurrentPrincipal.Identity. Console.WriteLine(SynchronizationContext.Current); Console.WriteLine("OnBar " + packet.resp); /* Console.WriteLine(Server.isSafeThread); await Scheduler.current.Yield(2000); Console.WriteLine("NExt"); //Console.WriteLine(packet.data); Console.WriteLine(Server.isSafeThread); */ var p = new FooPacket(); p.bind = "ASDdsddsFddd"; session.Send(p); }
public async void OnFoo(Session session, FooPacket packet) { FooPacket f = new FooPacket(); f.Serialize(); Console.WriteLine("OnPacket " + Thread.CurrentThread.ManagedThreadId.ToString()); packet.Dump(); var a = Scheduler.current.Schedule(() => { Console.WriteLine("hello world"); }, 100, 0, 2); a.Cancel(); // Model.FindOneAsync<Player>(packet); }
public async void OnChat(Session session, FooPacket packet) { Console.WriteLine("onChat"); }