public void Send(byte[] bytes, int index, int length, EndPoint endPoint)
{
// 这里的id我理解的,应该是channelId
long id = this.idEndpoints.GetKeyByValue(endPoint);
// 疑问1: tcp的情况下为何会出现id为0呢?不是应该在net层accept的时候,自动会创建出channel吗?
if (id == 0)
{
// 疑问2: channelId不是应该使用 NetServices.Instance.CreateConnectChannelId() 吗?
id = IdGenerater.Instance.GenerateInstanceId();
this.tService.Create(id, endPoint.ToString());
this.idEndpoints.Add(id, endPoint);
this.channelIds.Enqueue(id);
}
...