Skip to content

Commit 159b1f2

Browse files
authored
If initial advertisement multicast join fails, close the socket (#27)
1 parent a13ab83 commit 159b1f2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/OTPKit/Components/ComponentSocket.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ class ComponentSocket: NSObject, GCDAsyncUdpSocketDelegate {
243243
break
244244
case .multicastv4, .multicastv6:
245245
for group in multicastGroups {
246-
try join(multicastGroup: group)
246+
do {
247+
try join(multicastGroup: group)
248+
} catch {
249+
socket?.close()
250+
throw error
251+
}
247252
}
248253
}
249254

0 commit comments

Comments
 (0)