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


##########
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:
   You're right, however I am not entirely sure of netty vs plc4x lifecycle. 
Namely can we reestablish connection  once we reached that point? At high level 
plc4x drivers support `connect` call, we would need to assure that it  always 
configure fresh pipeline and uses new timeout manager forcing netty to fire 
bootstrap procedure again.



-- 
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