public override Task<byte[]> Recv()
{
if (this.Id == 0)
{
throw new Exception("TChannel已经被Dispose, 不能接收消息");
}
TaskCompletionSource<byte[]> tcs = new TaskCompletionSource<byte[]>();
byte[] packet = this.parser.GetPacket();
if (packet != null)
{
tcs.SetResult(packet);
}
else
{
recvTcs = tcs;
}
return tcs.Task;
}
}