Skip to content

Commit c67494e

Browse files
committed
Fixed wait(for:fileDescriptor:)
1 parent 322cd72 commit c67494e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/Socket/SocketManager/AsyncSocketManager.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ private extension AsyncSocketManager {
267267
try await withThrowingContinuation(for: fileDescriptor) { (continuation: SocketContinuation<(), Swift.Error>) -> () in
268268
// store pending continuation
269269
Task {
270+
guard await socket.pendingEvents.contains(events) == false else {
271+
continuation.resume()
272+
return
273+
}
270274
await socket.queue(events, continuation)
271275
}
272276
}

0 commit comments

Comments
 (0)