class wxInputFTPStream : public wxSocketInputStream
{
public:
- wxInputFTPStream(wxFTP *ftp_clt, wxSocketBase *sock)
- : wxSocketInputStream(*sock), m_ftp(ftp_clt)
+ wxInputFTPStream(wxFTP *ftp, wxSocketBase *sock)
+ : wxSocketInputStream(*sock)
{
+ m_ftp = ftp;
+
+ // FIXME make the timeout configurable
+
+ // set a shorter than default timeout
+ m_i_socket->SetTimeout(60); // 1 minute
}
size_t GetSize() const { return m_ftpsize; }
virtual ~wxInputFTPStream()
{
+ delete m_i_socket;
+
if ( LastError() == wxStream_NOERROR )
{
// wait for "226 transfer completed"
{
m_ftp->Abort();
}
-
- delete m_i_socket;
}
wxFTP *m_ftp;