An unhandled exception of type 'System.IO.IOException' occurred in system.dll
Additional information: Unable to read data from the transport connection.
The exception was raised after I leave the session purposely inactive.
I'm trying to learn a simple way to know the session status.
So, my test app have a button to send a NOOP command ( the most simple I can guess ).
I left the session idle more time than the server allows, and after that
tried the NoOperation( ) method.
The exception is raised in ftpcontrolsocket.cs, at ReadReply
internal virtual FTPReply ReadReply()
{
string line = reader.ReadLine(); // here is where the exception is raised
while (line != null && line.Length == 0)
line = reader.ReadLine();
Log(line, false);
.... more code follows
Could I patch the code with a try/catch block ?
But what is intriguing to me, is that this server surely sends a 421 reply before shutting down the connection.
So, it migth be in the input buffer of the socket, it seems.
Or when the other party closes the connection, Windows flushes al buffers ?
I'm using version 1.1.8