Skip to content

Commit 0834204

Browse files
committed
Web socket should end
1 parent d58d7b2 commit 0834204

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

FlyingFox/Sources/WebSocket/WSHandler.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public struct MessageFrameWSHandler: WSHandler {
105105
framesOut.yield(frame)
106106
}
107107
}
108+
framesOut.finish(throwing: nil)
108109
} catch FrameError.closed {
109110
framesOut.yield(.close(message: "Goodbye"))
110111
framesOut.finish(throwing: nil)

FlyingFox/Tests/WebSocket/WSHandlerTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ final class WSHandlerTests: XCTestCase {
116116
)
117117
}
118118

119+
func testResponseFramesEnds() async throws {
120+
let handler = MessageFrameWSHandler.make()
121+
let frames = try await handler.makeFrames(for: [.ping])
122+
123+
await AsyncAssertEqual(
124+
try await frames.collectAll(),
125+
[.pong]
126+
)
127+
}
119128
}
120129

121130
private extension MessageFrameWSHandler {

0 commit comments

Comments
 (0)