[ 
https://issues.apache.org/jira/browse/NET-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804826#action_12804826
 ] 

Paul Stanton commented on NET-35:
---------------------------------

if this problem has occurred (which it has) would interrupting the thread have 
any effect? ie, is this "an I/O operation upon an interruptible channel"?

http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#interrupt%28%29
"If this thread is blocked in an I/O operation upon an interruptible channel 
then the channel will be closed, the thread's interrupt status will be set, and 
the thread will receive a ClosedByInterruptException. "

> [net] FTPClient.setDataTimeout() should contain a default timeout
> -----------------------------------------------------------------
>
>                 Key: NET-35
>                 URL: https://issues.apache.org/jira/browse/NET-35
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: Operating System: Windows 2000
> Platform: PC
>            Reporter: David Parks
>
> The method FTPClient.setDataTimeout() appears not to have a default value, or 
> better said, it appears that the default value is 0, meaning that if a socket 
> hangs (which will happen with an ftp connection eventually) you may block 
> indefinately waiting on the connection.
> If we omit a call to setDataTimeout() it's almost certain that we will face a 
> bug in our code later on, and unfortunately it's relatively unlikely that 
> this 
> bug will be caught in development. I think it would be far safer to have a 
> default timeout value of say, pick a number, maybe 60 seconds? Those that 
> need 
> this changes should specically call it to make the change. If you do want it 
> to 
> block indefinately (I doubt almost anyone actually wants this) then they 
> should 
> explicitly set this to 0, but I think 99.9% of your users will actually want 
> a 
> resonable timeout, thus it would be best to set this 'resonable' timeout 
> value 
> as the default to safeguard those that miss adding it to their code.
> Thanks,
> David Parks

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to