[
https://issues.apache.org/jira/browse/HTTPCORE-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Kalnichevski resolved HTTPCORE-35.
---------------------------------------
Resolution: Invalid
> Isn't there then a race condition between me setting the callback or
> connection timeouts?
I do not think so. For instance, if the connection timeout is set after the
connect request has already been completed, it will just have no effect, which
seems reasonable. The access to SessionRequestCallback is synchronized. Even if
the callback is set after completing of the connect request it will still fire
an event depending on the outcome of the connect operation. I do not see a race
condition here.
public void setCallback(final SessionRequestCallback callback) {
synchronized (this) {
this.callback = callback;
if (this.completed) {
if (this.exception != null) {
callback.failed(this);
} else if (this.session != null) {
callback.completed(this);
}
}
}
}
Please feel free to re-open the issue if you think I am missing something
Oleg
> SessionRequest lifecycle seems inconsistent with its usage
> ----------------------------------------------------------
>
> Key: HTTPCORE-35
> URL: https://issues.apache.org/jira/browse/HTTPCORE-35
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.0-alpha3
> Reporter: Anders Wallgren
>
> The lifecycle of SessionRequest seems inconsistent with its intended usage.
> For example, it supports setting a connection timeout and a
> SessiongRequestCallback.
> However, ConnectingIOReactor returns a SessionRequest object from the connect
> method.
> Isn't there then a race condition between me setting the callback or
> connection timeouts?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]