Skip to content

Commit

Permalink
Start pingreq handler on handler added
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Nov 22, 2021
1 parent b7957d3 commit 55da431
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/MQTTNIO/ChannelHandlers/MQTTMessageHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ class MQTTMessageHandler: ChannelDuplexHandler {
self.decoder = .init(.init(version: client.configuration.version))
}

func channelActive(context: ChannelHandlerContext) {
func handlerAdded(context: ChannelHandlerContext) {
self.pingreqHandler?.start(context: context)
context.fireChannelActive()
}

func channelInactive(context: ChannelHandlerContext) {
func handlerRemoved(context: ChannelHandlerContext) {
self.pingreqHandler?.stop()
context.fireChannelInactive()
}

func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?) {
Expand Down

0 comments on commit 55da431

Please sign in to comment.