mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 11:53:28 +02:00
Replace magic number '30' for number of bits in message number
This commit is contained in:
parent
74547777df
commit
92dadb437c
2 changed files with 2 additions and 1 deletions
|
@ -27,6 +27,7 @@ namespace udt {
|
|||
static const int DEFAULT_SYN_INTERVAL_USECS = 10 * 1000;
|
||||
static const int SEQUENCE_NUMBER_BITS = sizeof(SequenceNumber) * 8;
|
||||
static const int MESSAGE_LINE_NUMBER_BITS = 32;
|
||||
static const int MESSAGE_NUMBER_BITS = 30;
|
||||
static const uint32_t CONTROL_BIT_MASK = uint32_t(1) << (SEQUENCE_NUMBER_BITS - 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ SequenceNumber SendQueue::getNextSequenceNumber() {
|
|||
}
|
||||
|
||||
uint32_t SendQueue::getNextMessageNumber() {
|
||||
static const MessageNumber MAX_MESSAGE_NUMBER = MessageNumber(1) << 30;
|
||||
static const MessageNumber MAX_MESSAGE_NUMBER = MessageNumber(1) << MESSAGE_NUMBER_BITS;
|
||||
_currentMessageNumber = (_currentMessageNumber + 1) % MAX_MESSAGE_NUMBER;
|
||||
return _currentMessageNumber;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue