Skip to content

Commit fdcafa2

Browse files
Merge pull request #281 from sbarow/fix_test_coverage
Move while loop read to own function
2 parents 40da1ce + a8f95b9 commit fdcafa2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/WebSockets.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,15 @@ public func websocket(
9898
}
9999
}
100100

101-
do {
101+
func read() throws {
102102
while true {
103103
let frame = try session.readFrame()
104104
try handleOperationCode(frame)
105105
}
106+
}
107+
108+
do {
109+
try read()
106110
} catch let error {
107111
switch error {
108112
case WebSocketSession.Control.close:

0 commit comments

Comments
 (0)