You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CUDTUnited::generateSocketID(..) uses the same m_SocketIDGenerator variable both for a single socket and a group socket ID generation.
It means that generating a single socket value e.g. 100, decrements m_SocketIDGenerator by one. The resulting Socket ID value is 100.
Next generating a group socket ID again decrements the value of m_SocketIDGenerator by one. The resulting Group Socket ID value is 99 | GROUP_MASK.
Generating next Socket ID produces the value 98, skipping value 98.
When m_SocketIDGenerator reaches its initial value of 100 (saved in m_SocketIDGenerator_init, no more sockets are generated with the default procedure.
However, some SocketIDs are still available.
So we get into checking iterating over occupied socket IDs in the loop under if (m_SocketIDGenerator_init == 0). From now on any new socket ID generation goes though this loop.
Using a separate m_GroupSocketIDGenerator variable could save some time before going into this procedure.
Also a check whether all Socket IDs are occupied: m_Sockets.size() and m_Groups.size() could be added.
SRT Version: v1.4.2,
The text was updated successfully, but these errors were encountered:
CUDTUnited::generateSocketID(..)
uses the samem_SocketIDGenerator
variable both for a single socket and a group socket ID generation.It means that generating a single socket value e.g. 100, decrements
m_SocketIDGenerator
by one. The resulting Socket ID value is 100.Next generating a group socket ID again decrements the value of
m_SocketIDGenerator
by one. The resulting Group Socket ID value is99 | GROUP_MASK
.Generating next Socket ID produces the value 98, skipping value 98.
When
m_SocketIDGenerator
reaches its initial value of 100 (saved inm_SocketIDGenerator_init
, no more sockets are generated with the default procedure.However, some SocketIDs are still available.
So we get into checking iterating over occupied socket IDs in the loop under
if (m_SocketIDGenerator_init == 0)
. From now on any new socket ID generation goes though this loop.Using a separate
m_GroupSocketIDGenerator
variable could save some time before going into this procedure.Also a check whether all Socket IDs are occupied:
m_Sockets.size()
andm_Groups.size()
could be added.SRT Version: v1.4.2,
The text was updated successfully, but these errors were encountered: