Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-3854

SO_REUSEADDR should be applied to server socket before bind()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.12, 0.14, 0.15
    • Fix Version/s: 0.15
    • Component/s: Broker-J
    • Labels:
      None

      Description

      In the IoNetworkTransport code, we currently apply the server socket option (SO_REUSEADDR) after the bind() call. This ordering is contrary to the documentation at http://docs.oracle.com/javase/6/docs/api/java/net/ServerSocket.html#setReuseAddress(boolean) which states:

      Enabling SO_REUSEADDR prior to binding the socket using bind(SocketAddress) allows the socket to be bound even though a previous connection is in a timeout state. When a ServerSocket is created the initial setting of SO_REUSEADDR is not defined. Applications can use getReuseAddress() to determine the initial setting of SO_REUSEADDR. The behaviour when SO_REUSEADDR is enabled or disabled after a socket is bound (See isBound()) is not defined.

        Attachments

          Activity

            People

            • Assignee:
              gemmellr Robbie Gemmell
              Reporter:
              k-wall Keith Wall
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: