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

support params TCP_KEEPIDLE/TCP_KEEPINTERVAL/TCP_KEEPCOUNT in Socket

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.3-alpha1
    • HttpCore
    • None

    Description

      It's known that TCP Keep-Alive time is 7200 seconds(default), default parameters do not meet all needs.

      If we could support setting TCP_KEEPIDLE, TCP_KEEPINTERVAL, TCP_KEEPCOUNT in Socket.
      SingleCoreIOReactor

          private void.prepareSocket(final Socket socket) throws IOException {
              socket.setTcpNoDelay(this.reactorConfig.isTcpNoDelay());
              socket.setKeepAlive(this.reactorConfig.isSoKeepAlive());
              if (this.reactorConfig.getSndBufSize() > 0) {
                  socket.setSendBufferSize(this.reactorConfig.getSndBufSize());
              }
              if (this.reactorConfig.getRcvBufSize() > 0) {
                  socket.setReceiveBufferSize(this.reactorConfig.getRcvBufSize());
              }
              if (this.reactorConfig.getTrafficClass() > 0) {
                  socket.setTrafficClass(this.reactorConfig.getTrafficClass());
              }
              final int linger = this.reactorConfig.getSoLinger().toSecondsIntBound();
              if (linger >= 0) {
                  socket.setSoLinger(true, linger);
              }
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            kkewwei kkewwei
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 20m
                1h 20m