steveohara / j2mod

Enhanced Modbus library implemented in the Java programming language
Apache License 2.0
276 stars 110 forks source link

Unexpected Connection Closed by peer #132

Closed chaos84731 closed 1 year ago

chaos84731 commented 2 years ago

Expected Behavior

Being able to write to coils and registers (single and multiple) without the connection being closed.

Actual Behavior

Random closure of the connection after writing to coils or registers.

Steps to Reproduce the Problem

  1. Send command via Simply Modbus TCP Client image

  2. Have the connection randomly close.

Specifications

Hi Randomly I will get a Error 66 (connection closed by peer) when I am writing registers. Please help.

Thanks

steveohara commented 1 year ago

Is it possible you can reproduce with a unit test?

chaos84731 commented 1 year ago

Turns out the Error was in my code and updating the Slave while writing values.