-
Notifications
You must be signed in to change notification settings - Fork 24
RFI: Adding a new device map to a running TCP Server #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ejrfisher I'll have to take a deeper look. Adding/removing handlers at runtime will definitely add a performance overhead, b/c that data structure must now be synchronized whereas before it was read-only after it was initialized. If you don't hear from me in the next few days please follow up. |
Honestly I wouldn't mind stopping the server and starting a new server with an updated device map since I hold on to each modbusUnitID's DeviceMap independently. But I can't seem to get that logic running either. After the Server Shutdown and Restart Everything on what I would consider the first (as in registered on the first Server Object) ModbusUnitId always ends up erroring out when you try and perform any client side reads. I assume this is because im doing something wrong with my deviceMap objects, but any insight you have would be great. Here is a combination of pseudocode and the actual success/error output I am getting right now, not sure if it is of any help but maybe you can spot an easy issue with my logic
|
Less of an Issue more of a question regarding the possibility to update a running Server objects deviceMap
From my understanding each Server uses a deviceMap object to map ModbusUnitID(s) to appropriate handlers with .addEndpoint().
Is there any way to have a running modbusServer with lets say an existing deviceMap of modbusUnitId = 1 and its respective handler and then update the deviceMap with another endpoint mapping modbusUnitId = 2 and its respective handlers?
Or is there a way to non-destructively create a new Server Object that replaces the currently running Server?
Currently if I try using two Server objects, I get a bind error (makes a lot of sense)
If I try to update the DeviceMap and then shutdown the running Server and create a new Server Object I get
2024-08-05 20:29:38 error: RESPONSE_TIMEOUT
when I try to read/write any value from the first deviceMap (i.e. modbusUnitId = 1)
The second deviceMap endpoint where modbusUnitId=2 works just fine.
Just wondering if you could share any insight. Happy to provide any and all information.
Thanks!
The text was updated successfully, but these errors were encountered: