spnettec commented on code in PR #822:
URL: https://github.com/apache/plc4x/pull/822#discussion_r1118926053


##########
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xNettyWrapper.java:
##########
@@ -200,85 +198,60 @@ public void userEventTriggered(ChannelHandlerContext ctx, 
Object evt) throws Exc
         // by sending a connection request to the plc.
         logger.debug("User Event triggered {}", evt);
         if (evt instanceof ConnectEvent) {
-            this.protocolBase.onConnect(new DefaultConversationContext<>(ctx, 
authentication, passive));
+            this.protocolBase.onConnect(new 
DefaultConversationContext<>(this::registerHandler, ctx, authentication, 
passive));
         } else if (evt instanceof DisconnectEvent) {
-            this.protocolBase.onDisconnect(new 
DefaultConversationContext<>(ctx, authentication, passive));
+            this.protocolBase.onDisconnect(new 
DefaultConversationContext<>(this::registerHandler, ctx, authentication, 
passive));
         } else if (evt instanceof DiscoverEvent) {
-            this.protocolBase.onDiscover(new DefaultConversationContext<>(ctx, 
authentication, passive));
+            this.protocolBase.onDiscover(new 
DefaultConversationContext<>(this::registerHandler, ctx, authentication, 
passive));
         } else if (evt instanceof CloseConnectionEvent) {
-            this.protocolBase.close(new DefaultConversationContext<>(ctx, 
authentication, passive));
+            this.protocolBase.close(new 
DefaultConversationContext<>(this::registerHandler, ctx, authentication, 
passive));

Review Comment:
   Fresh pipeline finnaly always invoke `PlcConnectionManager.getConnection` it 
will create fesh pipeline. If you don't stop the TimeManager it will caouse 
memory leak



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to