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
We've noticed that a SRT socket can't be used with the same IP address and port after the previous socket was closed. We've enhanced the function void CChannel::createSocket(int family) with the following two lines:
long reuseaddress = 1;
::setsockopt(m_iSocket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuseaddress, sizeof(reuseaddress));
Please can you add these lines to your source code?
The text was updated successfully, but these errors were encountered:
And one more thing: setting SO_REUSEADDR on the UDP socket allocated for the SRT Multiplexer object is a wrong approach. This flag causes that multiple sockets can be assigned to the same address, and therefore when reading from any of these two sockets the application will deliver the packet that was sent to this bound address. There's another fix pending for correct check for the binding process, which checks binding collision before it could fail due to system binding - without this fix the current code relies on that an attempt to bind a UDP socket would fail in case of collision. Such a fix (setting SO_REUSEADDR to 1) prevents this error and allows potentially multiple SRT sockets to be bound to the same address without sharing the multiplexer, which means that packets destined to one of them would be retrieved by a randomly chosen one of these sockets.
I'm not sure if you are right, but nethertheless it's only important for us, how you will fix the issue!
SO_REUSEADDR
Indicates that the rules used in validating addresses
supplied in a bind(2) call should allow reuse of local
addresses. For AF_INET sockets this means that a socket
may bind, except when there is an active listening socket
bound to the address. When the listening socket is bound
to INADDR_ANY with a specific port then it is not possible
to bind to this port for any local address. Argument is
an integer boolean flag.
We've noticed that a SRT socket can't be used with the same IP address and port after the previous socket was closed. We've enhanced the function void CChannel::createSocket(int family) with the following two lines:
long reuseaddress = 1;
::setsockopt(m_iSocket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuseaddress, sizeof(reuseaddress));
Please can you add these lines to your source code?
The text was updated successfully, but these errors were encountered: