I am in the middle of trying to write an ftp client but I did a fast re-write while awaiting reply from techie #9 and thought you may find my ideas a useful comparison for your work. I did not attempt a compile, the code is for your work in discovering clues to your post title.
the finally seems somewhat " except if the exception is an exceptional exception " which is a telltale of needing some formal school of development to be applied, but that is not immediately relevant to your post title.
[ December 30, 2007: Message edited by: Nicholas Jordan ]