EasyModbusTCP.NET icon indicating copy to clipboard operation
EasyModbusTCP.NET copied to clipboard

best way to handle this error: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

Open theladyjaye opened this issue 6 years ago • 2 comments

I frequently see this error when running either the example GUI apps in this repo or from my own application.

Currently, when I get it, I cleanup my client and reconnect. But I'm curious if this is the best way to handle this.

It seems like it only happens when I wait about 10 seconds with no I/O on the client.

theladyjaye avatar May 04 '19 01:05 theladyjaye

Same applies to me. I even check client.Connected before I use client.WriteMultipleCoils(0, values); and the error still appears.

bergi9 avatar Aug 01 '19 13:08 bergi9

I also get this occasionally:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

My device is connected directly to the machine I'm reading it from so it's odd that it's running into this issue.

theladyjaye avatar Aug 15 '19 15:08 theladyjaye