When sending data, that exceed maximum message size, Carrier will split in into several smaller ones. Maximum message data size is defined by variable m_maxMsgDataSizeBytes, which is calculated as following:
When data compression is enabled, in addition to datagram and message headers, carrier adds additional header with compression hint flags (added in CarrierThread::SendDatagram).
Compression header is not accounted in m_maxMsgDataSizeBytes and resulting split messages won't be sent due to following code from CarrierThread::GenerateOutgoingDataGram:
//If this Message can fit into the remaining Datagram buffer space
if ((msg.m_dataSize + GetMessageHeaderSize(msg, isWriteMessageSequenceId, isWriteReliableMessageSequenceId, isWriteChannel))
> (maxDatagramSize - writeBuffer.Size()))
{
break; // we can't add this message
}
Moreover, these messages will remain in send queue and completely block the network.
Issue happens only for messages, sent through custom network channels and not for regular game synchronization performed by replica manager. Replica manager uses channel 0, which is not included in message header, freeing up a necessary byte.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Hello @m9co! We've integrated your pull request and wanted to let you know that you should be able to see your changes in our next version of the Lumberyard engine. Thank you kindly for contributing to Lumberyard!
When sending data, that exceed maximum message size, Carrier will split in into several smaller ones. Maximum message data size is defined by variable m_maxMsgDataSizeBytes, which is calculated as following:
When data compression is enabled, in addition to datagram and message headers, carrier adds additional header with compression hint flags (added in CarrierThread::SendDatagram). Compression header is not accounted in m_maxMsgDataSizeBytes and resulting split messages won't be sent due to following code from CarrierThread::GenerateOutgoingDataGram:
Moreover, these messages will remain in send queue and completely block the network. Issue happens only for messages, sent through custom network channels and not for regular game synchronization performed by replica manager. Replica manager uses channel 0, which is not included in message header, freeing up a necessary byte.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.