-
Notifications
You must be signed in to change notification settings - Fork 131
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
TCP slave is stuck #40
Comments
you only set two. It's a usage problem. |
I have removed the rest eight registers from the code above to make it shorter. |
see the example below line 94
In your code, the slave would be destroy after the first request. |
Thanks for ideas. Added code:
and here are the logs (two requests from external software):
After that external software is freezing. In log there is no "after slave...", so this thread is waiting on wait() on tomcat side. I could run it as separate thread, but if synchronous not working, async will not either... |
I tested the slave shutdown code from the SimpleSlaveTCP.java example (line 99-117). My Slave is connected with a Master. I noticed that the code blocks in the wait method and never continuous with the shutdown of the slave. The communication with the Master is not aborted. I then used the code from the ModbusTest.java and the ExampleTCP.java i.e.:
This does not block but it still does not interrupt the communication with the Master. Only when I also set a new empty DataHolder to the slave, is the communication with the Master really interrupted:
Should perhaps the reset of the DataHolder be part of the slave shutdown method? Best Regards |
Hi @ippodamia, What do you mean by?
What type of |
Hello browncrane. Since the Socket has not been closed, the DataHolder of the Slave does not know that the Slave has been shutdown. I could check in my DataHolder methods (f.e. |
Hi @browncrane and @ippodamia, I ran into the same issue as @ippodamia. After calling the From my understanding of the code I looked into, the issue come from the following : The method I haven't found any workaround since no reference on the
I hope this will help. Simon ps : I'm using the version 1.2.9.7 |
I'm building Tomcat application to simulate Slave device. First query works, all data is read by external software (https://www.modbustools.com/), but then external software is stuck. Here are the logs on Slave:
If I run parallel instance of external software it is not getting data, logs on Slave:
Sometime at that even first external software got one response, but then stuck again.
When trying Disconnect in external software, it freeze and stop responding, so it might be something with network handling.
Code on Slave:
Terminating external software and run again is not helping.
Best regards,
The text was updated successfully, but these errors were encountered: