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
SRT use UDP socket, so the socket type should be SOCK_STREAM, this api is used to get the addrinfo with TCP type. It's not accurate, at least no perfect.
The usual steps to create a socket (TCP/UDP) is: socket(domain, type, protocol) -> bind(socket, const struct sockaddr*, address_len); I found create a UDP socket and bind with a TCP struct sockaddr is ok. It seem the system api is tolerant with this mistake, I also no idea whether it's a mistake or not. But I guess gives the socket a more accurate addr would be better.
Here is the code to verify bind socket with a struct sockaddr with different type.
I'm unsure about the correct parameter to use with the getaddrinfo function, which is utilized to obtain an address for binding a socket. Please conduct further research and study on this issue. If you confirm that this issue needs correction, please submit a pull request.
I appreciate your effort in researching and providing examples concerning this issue. However, it seems that more work is needed to fully understand the problem. I recommend reading and studying further, and doing more work to clarify this issue, until you can determine whether it is a bug.
srs/trunk/src/protocol/srs_protocol_srt.cpp
Line 197 in fa8096a
SRT use UDP socket, so the socket type should be
SOCK_STREAM
, this api is used to get theaddrinfo
with TCP type. It's not accurate, at least no perfect.The usual steps to create a socket (TCP/UDP) is: socket(domain, type, protocol) -> bind(socket, const struct sockaddr*, address_len); I found create a UDP socket and bind with a TCP
struct sockaddr
is ok. It seem the system api is tolerant with this mistake, I also no idea whether it's a mistake or not. But I guess gives the socket a more accurate addr would be better.Here is the code to verify bind socket with a
struct sockaddr
with different type.The text was updated successfully, but these errors were encountered: