private QueueNotification ( NetEvent data ) : bool | ||
data | NetEvent | |
return | bool |
internal bool QueueNotification(NetEvent data)
{
int notificationCount = this.outgoing.Count;
if (notificationCount >= NetConfig.MaxPendingNotifications)
{
NetDebug.LogError("Notification queue full");
return false;
}
data.Sequence = this.notificationSeq++;
this.outgoing.Enqueue(data);
return true;
}
NetPeer::QueueNotification ( byte data, ushort length ) : bool |
public void TestReliableCleanup() { NetPeer netPeer = new NetPeer(null, "Token", false, 0); for (int i = 0; i < 20; i++) netPeer.QueueNotification(new NetEvent()); netPeer.OnReceiveCarrier(0, 10, (x) => x = null); // First sequence number is 1, so we should have 10 remaining Assert.AreEqual(10, netPeer.Outgoing.Count()); }