Rebex FTP doesn't seem to be able to detect when the FTP server is no longer connected.
A couple of days ago I downloaded Rebex.Net.Ftp version 3.0.3854.0 for use with Visual Studio 2008 VB.
Using FileZilla Server 0.9.37, I connect to the FTP server thusly:
client.Connect(txtFtpHostOrIP.Text, txtPort.Text)
client.Login(txtUserName.Text, txtPassword.Text)
I can successfully traverse the directory structure and list directory contents.
I wanted to test my ability to detect when the FTP connection times out and is no longer connected. I attached the following code to a button. Clicking on the button before connecting results in "Not Connected" being displayed. Clicking on the button after connecting results in "Connected" being displayed.
However, if I:
- Let the connection time out.
- Click on the button - results in "Connected" being displayed, even though I know it's not connected.
Trying to change directories at this point results in the following error:
FtpExceptin was unhandled.
An established connection was aborted by the software in your host machine.
Any idea why the .GetConnectionState.Connected is not detecting that things are no longer connected? I don't want to use try/catch to determine when I don't have a connection, I want to use GetConnectionState.Connected.
Thanks,
Jim
Private Sub butDisplayState_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butViewAsHL7.Click
If client.GetConnectionState.Connected Then
Me.Text = "Connected"
Else
Me.Text = "Not Connected"
End If
End Sub