Qpid
  1. Qpid
  2. QPID-3854

SO_REUSEADDR should be applied to server socket before bind()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.12, 0.14, 0.15
    • Fix Version/s: 0.15
    • Component/s: Java Broker
    • 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.

        Activity

        Keith Wall created issue -
        Keith Wall made changes -
        Field Original Value New Value
        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:

        bq. 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.
        bq. 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.
        bq. The behaviour when SO_REUSEADDR is enabled or disabled after a socket is bound (See isBound()) is not defined.
        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:

        bq. 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.
        Hide
        Keith Wall added a comment -

        Hi Robbie, can you review this commit?

        Show
        Keith Wall added a comment - Hi Robbie, can you review this commit?
        Keith Wall made changes -
        Assignee Keith Wall [ k-wall ] Robbie Gemmell [ gemmellr ]
        Affects Version/s 0.12 [ 12316848 ]
        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:

        bq. 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.
        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:

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

        Hide
        Robbie Gemmell added a comment -

        Looks good to me.

        Show
        Robbie Gemmell added a comment - Looks good to me.
        Robbie Gemmell made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Rob Godfrey made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        20h 28m 1 Robbie Gemmell 19/Feb/12 19:37
        Resolved Resolved Closed Closed
        1088d 29m 1 Rob Godfrey 11/Feb/15 20:06

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development