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

Oleg Kalnichevski edited comment on HTTPCORE-295 at 3/7/12 4:50 PM:
--------------------------------------------------------------------

Jørgen,

Changes contained in the patch are very non-intrusive and generally I would 
have no problem committing them. However, please note it would be impossible to 
change TrafficClass of SSL I/O sessions because SSLIOSession is implemented as 
a decorator of IOSession interface rather than a sub-class of IOSessionImpl.

How about a slightly different approach? What if we just created an interface 
to obtain the underlying socket? This would provide the users with a means of 
tweaking properties of the connection sockets as they see fit and at the same 
time would have minimal impart on the existing API. 

{code}
interface SocketAccessor {

  Socket getSocket(); // may be null

}
{code}

{code}
class IOSessionImpl implements IOSession, SocketAccessor {
...
}
{code}

While not elegant this could be a reasonable stopgap solution until 5.0. 

Oleg
                
      was (Author: olegk):
    Jørgen,

Changes contained in the patch are very non-intrusive and generally I would 
have no problem committing them. However, please note it would be impossible to 
change TrafficClass of SSL I/O sessions because SSLIOSession is implemented as 
a decorator of IOSession interface rather than a sub-class of IOSessionImpl.

How about a slightly different approach? What if we just created an interface 
to obtain the underlying socket? This would provide the users with a means of 
tweaking properties of the connection sockets as they see fit and at the same 
time would have minimal impart on the existing API. 

{code}
interface SocketAccessor {

  Socket getSocket(); // may be null

}
{code}

{code}
class IOSession implements IOSession, SocketAccessor {
...
}
{code}

While not elegant this could be a reasonable stopgap solution until 5.0. 

Oleg
                  
> Change Traffic class of an established connection
> -------------------------------------------------
>
>                 Key: HTTPCORE-295
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-295
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore NIO
>    Affects Versions: 4.1.3, 4.2-beta1
>            Reporter: Jørgen Nordmoen
>            Priority: Minor
>         Attachments: hc.diff
>
>
> Request:
> Currently there is no possibility of changing the traffic class in HTTPCore, 
> this could be fixed by exposing the methods setTrafficClass(int) and 
> getTrafficClass() in 
> http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html. This can 
> already be done with setSocketTimeout(int), and there is also a feature 
> request for doing it with setTcpNoDelay() and setSocketKeepalive() 
> (https://issues.apache.org/jira/browse/HTTPCORE-288).
> Motivation:
> Supporting traffic class could be quite beneficial for HTTPComponents as it 
> allows projects depending on HC to control the quality of service. This could 
> be used by e.g. Apache Synapse to give outgoing request or replies different 
> QoS parameters depending on the client connecting to the service.
> Problems:
> As I'm not familiar enough with HTTPCore I can't give a precise suggestion 
> here, but just by guessing the same issues put forward by this issue: 
> https://issues.apache.org/jira/browse/HTTPCORE-288 might effect this request 
> to.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



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

Reply via email to