Hi @Isacco Simonini , Welcome to Microsoft Q&A,
You said you were able to establish a connection but it would crash after a few seconds without any feedback. This is not normal.
Without an error message, it's not clear what the specific error is.
Check the firewall settings on the other laptops to make sure they are not blocking Modbus TCP connections to the server. Sometimes firewalls block access to specific ports or IP addresses.
Because you only tested the second computer, this does not necessarily mean there is a problem with your program.
You also need to decide whether to test the Modbus TCP server independently to see if it can connect to other computers.
Create a simple program to test it out.
Check for resource leaks, such as connections not being closed properly or resources released. If resources are not released properly in your code, it can cause resource exhaustion after a long run, causing the connection to crash. Make sure you close the connection properly and release related resources when you are finished using it.
Check for concurrent access issues; multiple threads may be accessing the connection at the same time, causing race conditions and erratic behavior. Ensure proper synchronization and thread safety measures when accessing connections to avoid concurrent access issues.
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.