Skip to content

Integrate priority-based buffer into `Client` and `Server`

Daniel Fonseca Yarochewsky requested to merge LouYu2015:networking-dev into master

Created by: LouYu2015

Summary:

  • Added PacketBuffer.cs
  • Integrated priority-based packet buffer into Client and Server
  • 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 from Queue<Packet> to PacketBuffer
  • Field type change: ReceiveQueue from Queue<Packet> to QueueBuffer
  • Parameter list change: Start has new optional parameter UsePriorityQueue
  • Parameter list change: Send has new optional parameter Priority
  • Return value change: Send will return false 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 from Dictionary<string, Queue<Packet>> to Dictionary<string, PacketBuffer>
  • Field type change: ReceiveQueue from Queue<Packet> to QueueBuffer
  • Parameter list change: Start has new optional parameter UsePriorityQueue
  • Parameter list change: Send has new optional parameter Priority
  • New private method: CreateBufferIfClientIsNew

Communications in Communications/Constants.cs:

  • New type PacketPriority

Merge request reports