You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 15:16:33 +09:00
Added recycling to a few samples that lacked it
This commit is contained in:
@@ -75,6 +75,7 @@ namespace ChatClient
|
|||||||
Output("Unhandled type: " + im.MessageType + " " + im.LengthBytes + " bytes");
|
Output("Unhandled type: " + im.MessageType + " " + im.LengthBytes + " bytes");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
s_client.Recycle(im);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ namespace ChatServer
|
|||||||
Output("Unhandled type: " + im.MessageType + " " + im.LengthBytes + " bytes " + im.DeliveryMethod + "|" + im.SequenceChannel);
|
Output("Unhandled type: " + im.MessageType + " " + im.LengthBytes + " bytes " + im.DeliveryMethod + "|" + im.SequenceChannel);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
s_server.Recycle(im);
|
||||||
}
|
}
|
||||||
Thread.Sleep(1);
|
Thread.Sleep(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ namespace FileStreamClient
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
s_client.Recycle(inc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ namespace FileStreamServer
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
s_server.Recycle(inc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// stream to all connections
|
// stream to all connections
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ namespace FileStreamServer
|
|||||||
if (freeWindowSlots > 0)
|
if (freeWindowSlots > 0)
|
||||||
{
|
{
|
||||||
// send another part of the file!
|
// send another part of the file!
|
||||||
int remaining = (int)(m_inputStream.Length - m_sentOffset);
|
long remaining = m_inputStream.Length - m_sentOffset;
|
||||||
int sendBytes = (remaining > m_chunkLen ? m_chunkLen : remaining);
|
int sendBytes = (remaining > m_chunkLen ? m_chunkLen : (int)remaining);
|
||||||
|
|
||||||
// just assume we can read the whole thing in one Read()
|
// just assume we can read the whole thing in one Read()
|
||||||
m_inputStream.Read(m_tmpBuffer, 0, sendBytes);
|
m_inputStream.Read(m_tmpBuffer, 0, sendBytes);
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ namespace SpeedTestClient
|
|||||||
Output("Unhandled type: " + im.MessageType);
|
Output("Unhandled type: " + im.MessageType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
s_client.Recycle(im);
|
||||||
}
|
}
|
||||||
|
|
||||||
float now = (float)NetTime.Now;
|
float now = (float)NetTime.Now;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ namespace UnconnectedSample
|
|||||||
Peer.Recycle(im);
|
Peer.Recycle(im);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Peer.Recycle(im);
|
||||||
}
|
}
|
||||||
|
|
||||||
System.Threading.Thread.Sleep(1);
|
System.Threading.Thread.Sleep(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user