Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8216985

Socket(Proxy) should warn about binding and socket options set prior to connecting

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • None
    • core-libs

      The Socket(Proxy) constructor can be used to create a Socket that uses a SOCKS or HTTP proxy. The constructor creates an unconnected socket so it's possible to bind the socket to a local address/port or set socket options prior to connecting the socket. Binding or setting socket options prior to connect is a hazard as the underlying SocketImpl is replaced once the connection is established to the SOCKS or HTTP proxy. Minimally the javadoc for this constructor should include a warning or API note to make it clear that the local address or socket options may be lost when the connection is established to the proxy.

            michaelm Michael McMahon
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: