mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
more improvements/redesign, mostly Windows related
This commit is contained in:
@@ -99,7 +99,7 @@ void MulticastSocket::setInterface(const NetworkInterface& interfc)
|
||||
{
|
||||
if (!interfc.supportsIPv6())
|
||||
{
|
||||
impl()->setOption(IPPROTO_IP, IP_MULTICAST_IF, interfc.address());
|
||||
impl()->setOption(IPPROTO_IP, IP_MULTICAST_IF, interfc.findFirstAddress(IPAddress::IPv4));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -217,7 +217,7 @@ void MulticastSocket::joinGroup(const IPAddress& groupAddress, const NetworkInte
|
||||
{
|
||||
struct ip_mreq mr;
|
||||
std::memcpy(&mr.imr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
std::memcpy(&mr.imr_interface, interfc.address().addr(), interfc.address().length());
|
||||
std::memcpy(&mr.imr_interface, interfc.findFirstAddress(IPAddress::IPv4).addr(), interfc.findFirstAddress(IPAddress::IPv4).length());
|
||||
impl()->setRawOption(IPPROTO_IP, IP_ADD_MEMBERSHIP, &mr, sizeof(mr));
|
||||
}
|
||||
else
|
||||
@@ -245,7 +245,7 @@ void MulticastSocket::leaveGroup(const IPAddress& groupAddress, const NetworkInt
|
||||
{
|
||||
struct ip_mreq mr;
|
||||
std::memcpy(&mr.imr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
std::memcpy(&mr.imr_interface, interfc.address().addr(), interfc.address().length());
|
||||
std::memcpy(&mr.imr_interface, interfc.findFirstAddress(IPAddress::IPv4).addr(), interfc.findFirstAddress(IPAddress::IPv4).length());
|
||||
impl()->setRawOption(IPPROTO_IP, IP_DROP_MEMBERSHIP, &mr, sizeof(mr));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user