public Task HandleCall(IPacketSession session, InternalPacket packet) { var rpc = new RpcTunnel <TResponse, TRequest>(session, m_MethodInv, packet.MsgId); rpc.Start(); return(Task.Factory.StartNew(() => { using (rpc) { m_Handler .Invoke(rpc.GetReceiver(), new ServerCallContext()) .ContinueWith((taskResult) => rpc.Close(taskResult)) .Wait(); } })); }