[squeak-dev] FTPClient timeout problem

Ching de la Serna ching.dls at gmail.com
Tue Nov 3 05:20:44 UTC 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20091103/1013b9f3/attachment.htm


More information about the Squeak-dev mailing list