Skip to content

Commit

Permalink
Update from PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Nov 6, 2024
1 parent eeaca0b commit 7503f0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/HummingbirdWSCore/WebSocketHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ package actor WebSocketHandler {
func runAutoPingLoop() async throws {
let period = self.stateMachine.pingTimePeriod
try await Task.sleep(for: period)
loop: while true {
while true {
switch self.stateMachine.sendPing() {
case .sendPing(let buffer):
try await self.write(frame: .init(fin: true, opcode: .ping, data: buffer))
Expand All @@ -197,10 +197,10 @@ package actor WebSocketHandler {
case .closeConnection(let errorCode):
try await self.sendClose(code: errorCode, reason: "Ping timeout")
try await self.channel.close(mode: .input)
break loop
return

case .stop:
break loop
return
}
}
}
Expand Down

0 comments on commit 7503f0a

Please sign in to comment.