|
Summary
FTP connection has been closed.
Description
The OnClose event occurs usually in response to the Disconnect or Abort method (or in response to setting the Action property to ACTION_DISCONNECT or ACTION_ABORT). In some cases, the FTP
server may close a connection (for example because of a long period of inactivity). This will also trigger an OnClose event. In this case, the application must still set the Action property to
ACTION_DISCONNECT (or call the Disconnect method) to free up all the resources allocated for the connection. However, this should not be done during the OnClose event because it might result in an
infinite loop.
If this event occurs in response to setting the Action property to ACTION_DISCONNECT (or in response to the Disconnect method), it will occur before the statement following the assignment of
ACTION_DISCONNECT to the Action property (or the call to the Disconnect method) is reached.
Normally, an application should simply set a flag in response to this event. Then, this flag can be checked directly after the ACTION_DISCONNECT (or the Disconnect method) action to make sure that
the connection was actually terminated.
Example
Sub FTPClient_OnClose () Connected = False End Sub
See Also
Disconnect and Abort methods
|