Skip to content

Commit 55da431

Browse files
committed
Start pingreq handler on handler added
1 parent b7957d3 commit 55da431

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/MQTTNIO/ChannelHandlers/MQTTMessageHandler.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ class MQTTMessageHandler: ChannelDuplexHandler {
3434
self.decoder = .init(.init(version: client.configuration.version))
3535
}
3636

37-
func channelActive(context: ChannelHandlerContext) {
37+
func handlerAdded(context: ChannelHandlerContext) {
3838
self.pingreqHandler?.start(context: context)
39-
context.fireChannelActive()
4039
}
4140

42-
func channelInactive(context: ChannelHandlerContext) {
41+
func handlerRemoved(context: ChannelHandlerContext) {
4342
self.pingreqHandler?.stop()
44-
context.fireChannelInactive()
4543
}
4644

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

0 commit comments

Comments
 (0)