Windows multicast socket fix
This commit is contained in:
parent
0e7c7ce3dd
commit
9a3bddef19
1 changed files with 5 additions and 0 deletions
|
@ -1766,6 +1766,11 @@ uint16_t Socket::UDPConnection::bind(int port, std::string iface, const std::str
|
|||
sockaddr_in *addr4 = (sockaddr_in *)(rp->ai_addr);
|
||||
// multicast has a "1110" bit prefix
|
||||
multicast = (((char *)&(addr4->sin_addr))[0] & 0xF0) == 0xE0;
|
||||
#ifdef __CYGWIN__
|
||||
if (multicast){
|
||||
((sockaddr_in*)rp->ai_addr)->sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (multicast){
|
||||
const int optval = 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue