[jira] [Commented] (HTTPCORE-480) improve the code in check timeout

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

[jira] [Commented] (HTTPCORE-480) improve the code in check timeout

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/HTTPCORE-480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16111102#comment-16111102 ]

silver9886 commented on HTTPCORE-480:

set selectTimeout = timeoutCheckInterval in the code is not a good idea I think in the code .
because when retrun from the
 readyCount = this.selector.select(this.selectTimeout)
the timeout check is  just one of the all operations.
the other operations could be checked every selectTimeout. but the timeout check is no needed every selectTimeout.
timeout check  interval can be dynamicly set by the code .
that is set the timeoutCheckInterval  = min(all sessions timeout)

> improve the code in check timeout
> ---------------------------------
>                 Key: HTTPCORE-480
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-480
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore NIO
>    Affects Versions: 4.4.6
>            Reporter: silver9886
>            Priority: Minor
>             Fix For: 4.4.7
>         Attachments: AbstractIOReactor-change.png, BaseIOReactor-add class.png, BaseIOReactor-change.png
> change the code in org.apache.http.impl.nio.reactor.BaseIOReactor:
>         if( (currentTime - this.lastTimeoutCheck) >= this.timeoutCheckInterval) ->
>    if( (currentTime - this.lastTimeoutCheck) >= this.timeoutCheckInterval + 2)
> because :the code will run for a time and network tranport expend the time too.  So currentTime - this.lastTimeoutCheck should be
> larger than selectTimeout in order to check timeout. In this case , This will make the code more efficiency.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]