private bool UpdateSendActiveMessages()
{
foreach (var message in this.m_ActiveMessages)
{
if (message.HasPendingSends())
{
// Iterate through all of the fragments in the list, and call Send() on the client.
// Since the client is in reliable mode, it will send exactly one fragment at a time, thus
// reducing the loss over UDP.
foreach (var fragment in message.CurrentSendFragments)
{
if (fragment.Status == FragmentStatus.WaitingOnSend)
{
this.m_Client.EnqueueSend(fragment.Data, MxMessage.ReliableProtocol);
fragment.Status = FragmentStatus.WaitingOnAcknowledgement;
}
}
// Re-evaluate the active messages to find and finalize any that
// have been full acknowledged.
this.CheckForFullAcknowledgement();
// We only deal with one active message per update.
return true;
}
}
// We didn't send any message this update.
return false;
}