您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
756 B
31 行
756 B
using System.Collections.Generic;
|
|
|
|
namespace LiteNetLib
|
|
{
|
|
internal abstract class BaseChannel
|
|
{
|
|
public BaseChannel Next;
|
|
protected readonly NetPeer Peer;
|
|
protected readonly Queue<NetPacket> OutgoingQueue;
|
|
|
|
protected BaseChannel(NetPeer peer)
|
|
{
|
|
Peer = peer;
|
|
OutgoingQueue = new Queue<NetPacket>(64);
|
|
}
|
|
|
|
public int PacketsInQueue
|
|
{
|
|
get { return OutgoingQueue.Count; }
|
|
}
|
|
|
|
public void AddToQueue(NetPacket packet)
|
|
{
|
|
lock (OutgoingQueue)
|
|
OutgoingQueue.Enqueue(packet);
|
|
}
|
|
|
|
public abstract void SendNextPackets();
|
|
public abstract bool ProcessPacket(NetPacket packet);
|
|
}
|
|
}
|