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