spuranam / ftp4go

Automatically exported from code.google.com/p/ftp4go
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

missing FTP SetTimeout method #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello, i missed this method, and added it in my own copy of ftp4go :

// SetTimeout sets the timeout for command and data transfers, in milliseconds.
// (added by notnot@xs4all.nl)
func (ftp *FTP) SetTimeout(msecs int64) {
    if msecs >= 0 {
        ftp.timeoutInMsec = msecs
        if ftp.conn != nil {
            ftp.conn.SetDeadline(getTimeoutInMsec(ftp.timeoutInMsec))
        }
    }
}

Having this in the official package seems like a good idea, all the more 
because the default of 1000 ms is really short!

Thanks for your efforts in developing this package, i have a need for it, and 
it seems to work fine :)
Do you plan on adding TLS support any time soon?

Erwin
notnot@xs4all.nl

Original issue reported on code.google.com by 1melkb...@gmail.com on 27 Jul 2012 at 6:28

GoogleCodeExporter commented 9 years ago
Hi Erwin, 

I finally found some time to update the code to the latest version of Go. 
In the revision process I decided to comment out the timeout for now (since it 
is an absolute date that needs refreshing on every read/write operation). 
Support for socks5 proxy has been added, TLS not yet.

Enrico

Original comment by mezz...@gmail.com on 14 Aug 2013 at 7:48