FTPClient timeout problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FTPClient timeout problem

ching
Hi All,

Is there a good way to handle Socket timeouts when transferring files to a server?

ftp _ FTPClient openOnHostNamed: remoteHost.
....some code
ftp putFileNamed: 'something; as: 'something'.  <---error when connecting to remoteHost 

Socket>>connectTo: hostAddress port: port waitForConnectionFor: timeout 
"Initiate a connection to the given port at the given host 
address. Waits until the connection is established or time outs."
self connectNonBlockingTo: hostAddress port: port.
self
waitForConnectionFor: timeout
ifTimedOut: [ConnectionTimedOut signal: 'Cannot connect to '
, (NetNameResolver stringFromAddress: hostAddress) , ':' , port asString]

Thanks in advance,

Ching