Skip to content

Commit

Permalink
Merge pull request #14 from jasoncodes/websocket-ping
Browse files Browse the repository at this point in the history
Reply to WebSocket ping frames
  • Loading branch information
sroebert authored Nov 22, 2022
2 parents cf13f4a + 2508624 commit ad1f0bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/MQTTNIO/Handlers/WebSocketHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ final class WebSocketHandler: ChannelDuplexHandler {
frameSequence.append(frame.data)
self.frameSequence = frameSequence

case .ping:
send(context: context, buffer: frame.data, opcode: .pong)

case .connectionClose:
isClosed = true
context.close(promise: nil)
Expand Down

0 comments on commit ad1f0bc

Please sign in to comment.