What steps will reproduce the problem?
1. Close a ModbusTCPSlave after the master has ended the connection.
2.
3.
What is the expected output? What do you see instead?
ModbusTCPSlave should close gracefully. An IOException is thrown. The
call to _stream.EndWrite(ar) will generate an IOException if the server had
already forcibly closed the connection. The line should probably handle
the IOException. In any event, the code looks like this:
File: ModbusTcpSlave.cs
Lines: 179 to 193
Function: WriteCompleted
internal void WriteCompleted(IAsyncResult ar)
{
_log.Debug("End write.");
_stream.EndWrite(ar);
try
{
_stream.BeginRead(_mbapHeader, 0, 6, ReadHeaderCompleted, null);
}
catch (IOException)
{
_log.Debug("Master has closed Socket connection.");
RemoveMaster(_endPoint);
}
}
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by robma...@gmail.com on 13 Dec 2007 at 3:07
Original issue reported on code.google.com by
robma...@gmail.com
on 13 Dec 2007 at 3:07