[
https://issues.apache.org/jira/browse/HTTPCORE-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16558614#comment-16558614
]
Gary Gregory commented on HTTPCORE-544:
---------------------------------------
Right, so the question becomes: What is the lifecycle of an EndpointDetails
object? Right now, the TO is _copied_ from either a Socket or an IOSession.
In the case of a Socket:
[https://git-wip-us.apache.org/repos/asf?p=httpcomponents-core.git;a=blobdiff;f=httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java;h=17f70574eddbe00abc25f604cb92942ad818b0db;hp=94223fd1c31a3fed48d02b4aaa3849674a14c049;hb=9059928;hpb=04f7eb616e70665d58b3ece152be0990cf606d58]
The TO comes from the Socket.
The Socket comes from the SocketHolder.
The SocketHolder comes from an AtomicReference in BHttpConnectionBase.
Setting the socket timeout on a BHttpConnectionBase works all the work from the
AtomicReference to the actual Socket.
So the EndpointDetail could hold on to the AtomicReference instead of the int.
The getter in EndpointDetail would go all the de-referencing.
In the case of an IOSession:
-
[https://git-wip-us.apache.org/repos/asf?p=httpcomponents-core.git;a=blobdiff;f=httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java;h=59c03a33bdd4aa287b3a2e1ae00100ba80ed5d64;hp=f17e3a84cbf9fdc3e15221d1fbb1a073f360dcc5;hb=9059928;hpb=04f7eb616e70665d58b3ece152be0990cf606d58]
-
[https://git-wip-us.apache.org/repos/asf?p=httpcomponents-core.git;a=blobdiff;f=httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java;h=9cd76b642621d21af322cc2f255c021ae428794c;hp=4e3686a5ab1dbcc59dad5bf83c262c11c7114d04;hb=9059928;hpb=04f7eb616e70665d58b3ece152be0990cf606d58]
This is more tricky but we can assume that the value can change since this
interface has both a getter and setter.
As above, the EndpointDetail could hold on to an IOSession and the ED getter
could just delegate to the IOSession. But then we might have an ED track both
an IOSession and AtomicRef to a SocketHolder, which would be ugly.
The same question applies: Can the Socket TO change _during_ the lifetime of an
Endpoint detail. This I do not know. Do you?
> Add org.apache.hc.core5.http.EndpointDetails.getSocketTimeout()
> ---------------------------------------------------------------
>
> Key: HTTPCORE-544
> URL: https://issues.apache.org/jira/browse/HTTPCORE-544
> Project: HttpComponents HttpCore
> Issue Type: New Feature
> Reporter: Gary Gregory
> Assignee: Gary Gregory
> Priority: Major
> Fix For: 5.0-beta3
>
>
> Add {{org.apache.hc.core5.http.EndpointDetails.getSocketTimeout()}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]