Re: Timeout Property - WeOnlyDo Discussion board

Re: Timeout Property (General questions)

by kdcarlisle, Thursday, May 28, 2009, 15:50 (5659 days ago) @ woddrazen

Hi Drazen,

Originally the code set the Timeout property to 0 (which disables the auto-disconnect). I changed the code to set the value to 30 seconds before the call to .Connect. I was assuming that if the connect had an issue (ie: got hung, server busy, etc.) that it would either (1) return out or (2) throw a TimeoutException.

Once the connection has been made I wanted to set the Timeout property back to a 0 (disabling the auto-disconnect). I did this based on another post in the forum.

After I made those changes and installed the updated code nothing has changed (that I can tell). The occasional hang still happens and is eventually timed out via Visual Cron.

Basically here is what I to happen.

1) cmdlet starts up
2) paramters are validated
3) connection is made to ftp server [if any issue or hang throw exception]
4) cmdlet processes request (get/put/remove)
5) ftp disconnects from server
6) cmdlet shuts down

Since this is all done sequentially we took the simple straight forward approach and used blocking.

I did notice in another post someone mentioned using an undocumented feature .DebugFile. I can add this into the cmdlet if you believe it will write out information before it hangs.

-Kent



Complete thread: