Replies: 1 comment
-
You might be able to listen for client disconnects with something like this: var channelInactiveHandler =
new ChannelInboundHandlerAdapter() {
@Override
public void channelInactive(ChannelHandlerContext ctx) {
System.out.println("Client disconnected: " + ctx.channel().remoteAddress());
ctx.fireChannelInactive();
}
};
var serverTransport =
NettyTcpServerTransport.create(
cfg -> {
cfg.bindAddress = "localhost";
cfg.port = port;
cfg.pipelineCustomizer = pipeline -> pipeline.addLast(channelInactiveHandler);
}); How you would signal that to the other connected client(s) is something you would have to invent, there is nothing like that defined by Modbus. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Now, we are using ditailpetri as modbus proxy.
digitalpetri is working as slave and connecting 2 masters.
question. when 1 master is disconned, digitalpetri can send this signal to another master?
FYI: We got this error when 1 master was disconnected.
2025-04-23 04:03:01.238 [modbus-netty-event-loop-0] DEBUG c.d.modbus.slave.ModbusTcpSlave - Master/client channel closed: [id: 0xf5169886, L:/10.42.0.205:5520 ! R:/10.42.0.1:48964]
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions