[ 
https://issues.apache.org/jira/browse/HTTPCORE-377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleg Kalnichevski resolved HTTPCORE-377.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.4-alpha1

I spent some time trying to figure out the reason for the existing 
implementation, which pretty much goes back to the days of HC 3.0

The existing handling of SO_LINGER appears illogical. It does not prevent 
abortive connection close, which can still happen after a positive linger 
period, but for some reason it it disallows immediate abortive close.

I am still not entirely sure whether positive SO_LINGER values make any sense 
in context of HTTP, but this is way above my rudimentary understanding of 
TCP/IP. It is probably just easier to let users decide.

Patch committed to SVN trunk. Please review / re-test.

Oleg

PS: If you happen to have some bandwidth to investigate whether or not positive 
SO_LINGER has its use in HTTP communication, it would be quite welcome. If it 
does not, it would probably make sense to deprecate the old parameter and 
replace it with a simple boolean 'abortive close' flag. 


> Allow to enable SO_LINGER option with zero timeout
> --------------------------------------------------
>
>                 Key: HTTPCORE-377
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-377
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore, HttpCore NIO
>    Affects Versions: 4.3.2
>            Reporter: Dmitry Potapov
>            Priority: Minor
>             Fix For: 4.4-alpha1
>
>         Attachments: httpcore-enable-linger.patch
>
>
> According to 
> http://docs.oracle.com/javase/8/docs/api/java/net/StandardSocketOptions.html#SO_LINGER
>  linger option is disabled by default. Currently if SocketConfig.soLinger is 
> set to zero (default value is -1), then Socket.setSoLinger(false, 0) will be 
> called, so linger will be disabled, which is undesirable. My suggestion is 
> interpret zero soLinger value as Socket.setSoLinger(true, 0).
> I understand that this change will break backward compatibility of config 
> interpretation, but can we have this in 4.4?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to