Да знаю я про флаг.
Я использую EasyModbus.
У меня сделано так:
modbusClient.Disconnect();
Смотрим ModbusClient:
Код:
public void Disconnect()
{
if (this.serialport != null) {
if (this.serialport.IsOpen) {
this.serialport.Close();
}
}
else {
if (this.stream != null) {
this.stream.Close();
}
if (this.tcpClient != null) {
this.tcpClient.Close();
}
}
}
Смотрим что за tcpClient:
private TcpClient tcpClient;
А вот что юзает ModbusClient:
using System;
using System.IO.Ports;
using System.Net;
using System.Net.Sockets;
using System.Threading;
Так что причем тут FIN? Что-то подозреваю, что майкрософтовский Net работает без ошибок...