Integrate priority-based buffer into `Client` and `Server`
Created by: LouYu2015
Summary:
- Added
PacketBuffer.cs
- Integrated priority-based packet buffer into
Client
andServer
- Added unit test project
Communications
in Communications/PacketBuffer.cs
:
- New abstract class
PacketBuffer
- New class
QueueBuffer
- New class
PriorityBuffer
- New class
BandwidthControlBuffer
- New class
GenericController
Communications.Packet
in Communication/Packet.cs
:
- New method
GetLength
Communications.Client
in Communications/Client.cs
:
- New public-get private-set field
DefaultPriority
- Field type change:
SendQueue
fromQueue<Packet>
toPacketBuffer
- Field type change:
ReceiveQueue
fromQueue<Packet>
toQueueBuffer
- Parameter list change:
Start
has new optional parameterUsePriorityQueue
- Parameter list change:
Send
has new optional parameterPriority
- Return value change:
Send
will returnfalse
if the packet is not added to queue - Behavior change:
SendPackets
won't clone packet because packet is already cloned before adding to buffer.
Communications.Server
in Communications/Server.cs
:
- New public-get private-set field
PriorityQueueEnabled
- New public-get private-set field
DefaultPriority
- Field type change:
SendQueues
fromDictionary<string, Queue<Packet>>
toDictionary<string, PacketBuffer>
- Field type change:
ReceiveQueue
fromQueue<Packet>
toQueueBuffer
- Parameter list change:
Start
has new optional parameterUsePriorityQueue
- Parameter list change:
Send
has new optional parameterPriority
- New private method:
CreateBufferIfClientIsNew
Communications
in Communications/Constants.cs
:
- New type
PacketPriority