Skip to content

Commit

Permalink
Merge pull request #19 from dsmurfin/missing-ipv6-address
Browse files Browse the repository at this point in the history
Resolves an issue joining multicast when no IPv6 address present
  • Loading branch information
dsmurfin authored Aug 21, 2022
2 parents 82f39d9 + c920b43 commit 48c8d5a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/OTPKit/Components/ComponentSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,12 @@ class ComponentSocket: NSObject, GCDAsyncUdpSocketDelegate {
do {
switch socketType {
case .unicast:
// try socket?.sendIPv4Multicast(onInterface: interface)
try socket?.sendIPv6Multicast(onInterface: interface)
// if multicastGroups.contains(where: { IPv4Address($0) != nil }) {
// try socket?.sendIPv4Multicast(onInterface: interface)
// }
if multicastGroups.contains(where: { IPv6Address($0) != nil }) {
try socket?.sendIPv6Multicast(onInterface: interface)
}
case .multicastv4, .multicastv6:
break
}
Expand Down

0 comments on commit 48c8d5a

Please sign in to comment.