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

Oleg Kalnichevski commented on HTTPCORE-377:
--------------------------------------------

Dmitry
I am not a TCP/IP specialist by any stretch of imagination but I always thought 
zero linger value was meant to be used for abortive close (socket RST) as 
described here [1]

Another question is why you are using SO_LINGER with HTTP protocol in the first 
place given that HTTP always delineates message bodies and therefore there can 
be no stray packets with HTTP?

Oleg

PS: It looks like we ought to deprecate this option for non-blocking 
connections and unless I am missing some legitimate use cases of SO_LINGER we 
probably ought to do the same for blocking connections 

[1] 
http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html

> 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
>         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