Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-288

Change TCP_NODELAY and SO_KEEPALIVE on the fly

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.2-alpha2
    • Fix Version/s: 4.2
    • Component/s: HttpCore, HttpCore NIO
    • Labels:
      None

      Description

      Request:
      HttpConnection#setTcpNoDelay() and setSocketKeepalive() methods to modify those socket settings on the fly like can be done with setSocketTimeout()

      Motivation:
      Set different socket options depending on the request to support different services on the same port. E.g. turn on TCP_NODELAY for requests to an AJAX-based unix shell, but turn it off for transferring large files. Turn on SO_KEEPALIVE and turn off socket timeout for long poll (comet) requests, but not for other requests.

      Potential problem:
      When using persistent connections it is easy to forget that these options survive to the next request. This situation exists with socket timeout already, though. You have to remember to set it back when sending a response if you don't want it for the next request. Perhaps a way to set timeout/nodelay/keepalive temporarily only for the current request is useful. Either way, I'd be happy to just be able to set nodelay and keepalive on the fly.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              drharibo Geir Harald Hansen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: