Class JSSSocket

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class JSSSocket
    extends javax.net.ssl.SSLSocket
    SSL-enabled socket following the javax.net.ssl.SSLSocket interface. Most users will want to use the JSSSocketFactory provided by the Java Provider interface instead of using this class directly. This SSLSocket implementation is a wrapped implementation. In particular, we need to consume an existing Socket (via the consumeSocket(...) call) which we actually send data over. When called from a socket factory, this additional socket will be automatically created for the caller. This is necessary because SSLSocketFactory includes a mode which wraps an existing socket. All JSSSocket instances have a underlying SocketChannel, of type JSSSocketChannel. Notably lacking is a javax.net.ssl.SSLSocketChannel type, so JSSSocketChannel includes no additional SSL-specific options. However, the core of the SSLEngine wrapping logic exists there. In order to interoperate with JSSEngine, many of the adjacent methods have been included in this class as well. This socket can either be a client or a server, depending on how it was created. For more information, see the javax.net.ssl.SSLSocket documentation. To construct a (useful) new instance, the following calls must be made: - new JSSSocket(); - consumeSocket(inst); - initSSLEngine(...); - setKeyManagers(...); - setTrustManagers(...); Optionally, setSSLContext(...) could be called to provide the SSLContext from which the SSLEngine should be constructed. This should be called prior to initSSLEngine(...) being called.
    • Constructor Summary

      Constructors 
      Constructor Description
      JSSSocket()
      Start building a new JSSSocket.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHandshakeCompletedListener​(javax.net.ssl.HandshakeCompletedListener callback)
      Add a callback to fire on handshake completion.
      void bind​(java.net.SocketAddress bindpoint)  
      void close()  
      void connect​(java.net.SocketAddress endpoint)  
      void connect​(java.net.SocketAddress endpoint, int timeout)  
      void consumeSocket​(java.net.Socket parent)
      Consume a parent socket, utilizing it for all read/write operations.
      boolean getAutoClose()
      Get the autoClose status of this socket, that is, whether or not its parent socket will be automatically closed.
      JSSSocketChannel getChannel()
      Get the underlying SocketChannel for this Socket.
      java.lang.String[] getEnabledCipherSuites()
      Get the set of enabled cipher suites for this SSLSocket.
      java.lang.String[] getEnabledProtocols()
      Get the set of enabled protocol versions for this SSLSocket.
      boolean getEnableSessionCreation()
      Get whether or not this SSLSocket enables creation of new sessions.
      JSSEngine getEngine()
      Get the underlying JSSEngine instance.
      javax.net.ssl.SSLSession getHandshakeSession()
      Get the initial session constructed during handshaking.
      java.net.InetAddress getInetAddress()  
      java.io.InputStream getInputStream()
      Get a copy of an input stream for this Socket.
      protected JSSSocketChannel getInternalChannel()
      Helper to always return the channel for this socket, initializing it if it isn't yet created.
      boolean getKeepAlive()  
      java.util.Collection<? extends java.util.EventListener> getListeners()
      Gets the current list of event listeners this SSLSocket will fire on certain events.
      java.net.InetAddress getLocalAddress()  
      int getLocalPort()  
      java.net.SocketAddress getLocalSocketAddress()  
      boolean getNeedClientAuth()
      Get whether or not this SSLSocket needs client authentication.
      boolean getOOBInline()  
      <T> T getOption​(java.net.SocketOption<T> name)  
      java.io.OutputStream getOutputStream()
      Get a copy of an output stream for this Socket.
      int getPort()  
      int getReceiveBufferSize()  
      java.net.SocketAddress getRemoteSocketAddress()  
      boolean getReuseAddress()  
      int getSendBufferSize()  
      javax.net.ssl.SSLSession getSession()
      Get the established session for this SSLSocket.
      int getSoLinger()  
      int getSoTimeout()  
      protected javax.net.ssl.SSLContext getSSLContext()
      Get the SSLContext if one exists or create a new instance.
      JSSParameters getSSLParameters()
      Get the configuration of this SSLSocket as a JSSParameters object.
      java.lang.String[] getSupportedCipherSuites()
      Get the set of supported cipher suites for this SSLSocket.
      java.lang.String[] getSupportedProtocols()
      Get the set of supported protocol versions for this SSLSocket.
      boolean getTcpNoDelay()  
      int getTrafficClass()  
      boolean getUseClientMode()
      Get whether or not this SSLSocket is handshaking as a client.
      boolean getWantClientAuth()
      Get whether or not this SSLSocket wants client authentication.
      void initEngine()
      Explicitly initialize the SSLEngine with no session resumption information.
      void initEngine​(java.lang.String host, int port)
      Explicitly initialize the SSLEngine with information for session resumption, including peer's hostname and port.
      boolean isBound()  
      boolean isClosed()  
      boolean isConnected()  
      boolean isInputShutdown()  
      boolean isOutputShutdown()  
      protected void notifyHandshakeCompletedListeners()
      Internal helper to fire callbacks on handshake completion.
      void removeHandshakeCompletedListener​(javax.net.ssl.HandshakeCompletedListener callback)
      Remove a callback from firing on handshake completion.
      void sendUrgentData​(int data)  
      void setAutoClose​(boolean on)
      Set the autoClose status of this socket, that is, whether or not its parent socket will be automatically closed.
      void setCertFromAlias​(java.lang.String alias)
      Set the certificate this SSLSocket will utilize from an alias in the NSS DB.
      void setConsumedData​(java.io.InputStream consumed)
      Helper to inform this socket of data already consumed from the wrapped socket.
      void setEnabledCipherSuites​(java.lang.String[] suites)
      Set the list of enabled cipher suites for this SSLSocket.
      void setEnabledProtocols​(java.lang.String[] protocols)
      Set the list of enabled protocol versions for this SSLSocket.
      void setEnableSessionCreation​(boolean enabled)
      Set whether or not this SSLSocket enables creation of new sessions.
      void setHostname​(java.lang.String name)
      Set the hostname this client socket is connecting to, for HTTPS TLS certificate validation purposes.
      void setKeepAlive​(boolean on)  
      void setKeyManager​(javax.net.ssl.X509KeyManager km)
      Set the KeyManager this SSLSocket will utilize to select a key.
      void setKeyManagers​(javax.net.ssl.X509KeyManager[] xkms)
      Set the key managers this SSLSocket will utilize to select a key.
      void setKeyMaterials​(PK11Cert our_cert, PK11PrivKey our_key)
      Set the certificate this SSLSocket will utilize from a certificate and its matching private key.
      void setListeners​(java.util.Collection<? extends java.util.EventListener> listeners)
      Set the listeners this SSLSocket will fire on certain events.
      void setNeedClientAuth​(boolean need)
      Set whether or not this SSLSocket needs client authentication.
      void setOOBInline​(boolean on)  
      <T> java.net.Socket setOption​(java.net.SocketOption<T> name, T value)  
      void setPerformancePreferences​(int connectionTime, int latency, int bandwidth)  
      void setReceiveBufferSize​(int size)  
      void setReuseAddress​(boolean on)  
      void setSendBufferSize​(int size)  
      void setSoLinger​(boolean on, int linger)  
      void setSoTimeout​(int timeout)  
      void setSSLContext​(javax.net.ssl.SSLContext ctx)
      Explicitly set the SSLContext utilized by this JSSSocket instance.
      void setSSLParameters​(javax.net.ssl.SSLParameters params)
      Set the configuration of this SSLSocket from the given SSLParameters instance.
      void setTcpNoDelay​(boolean on)  
      void setTrafficClass​(int tc)  
      void setTrustManager​(JSSTrustManager tm)
      Set the trust manager this SSLSocket will utilize to validate a peer's certificate.
      void setTrustManagers​(javax.net.ssl.X509TrustManager[] xtms)
      Set the trust managers this SSLSocket will utilize to validate a peer's certificate.
      void setUseClientMode​(boolean client)
      Set whether or not this SSLSocket is handshaking as a client.
      void setWantClientAuth​(boolean want)
      Set whether or not this SSLSocket wants client authentication.
      void shutdownInput()  
      void shutdownOutput()  
      void startHandshake()
      Begin a handshake, blocking to completion; this will begin a new handshake when one has already been issued.
      java.util.Set<java.net.SocketOption<?>> supportedOptions()  
      java.lang.String toString()  
      • Methods inherited from class javax.net.ssl.SSLSocket

        getApplicationProtocol, getHandshakeApplicationProtocol, getHandshakeApplicationProtocolSelector, setHandshakeApplicationProtocolSelector
      • Methods inherited from class java.net.Socket

        setSocketImplFactory
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JSSSocket

        public JSSSocket()
        Start building a new JSSSocket. We specifically avoid creating any other constructors as we wish to consume an existing socket rather than creating a new one.
    • Method Detail

      • consumeSocket

        public void consumeSocket​(java.net.Socket parent)
                           throws java.io.IOException
        Consume a parent socket, utilizing it for all read/write operations. This JSSSocket instance will inherit all information about the connection from this underlying socket. When utilized in a JSSSocket, callers should refrain from interacting with the underlying socket directly until the TLS connection is closed. Otherwise, messages may get dropped.
        Throws:
        java.io.IOException
      • getSSLContext

        protected javax.net.ssl.SSLContext getSSLContext()
                                                  throws java.io.IOException
        Get the SSLContext if one exists or create a new instance. This is used by initSSLEngine(..) to create the underlying SSLEngine.
        Throws:
        java.io.IOException
      • setSSLContext

        public void setSSLContext​(javax.net.ssl.SSLContext ctx)
                           throws java.io.IOException
        Explicitly set the SSLContext utilized by this JSSSocket instance. This enables JSSServerSocket to copy its SSLContext over to the accepted JSSSocket.
        Throws:
        java.io.IOException
      • initEngine

        public void initEngine()
                        throws java.io.IOException
        Explicitly initialize the SSLEngine with no session resumption information.
        Throws:
        java.io.IOException
      • initEngine

        public void initEngine​(java.lang.String host,
                               int port)
                        throws java.io.IOException
        Explicitly initialize the SSLEngine with information for session resumption, including peer's hostname and port.
        Throws:
        java.io.IOException
      • getEngine

        public JSSEngine getEngine()
        Get the underlying JSSEngine instance. Note that, just like accessing the underlying Socket instance while the JSSSocket instance is still open is dangerous, performing other TLS operations directly via JSSEngine is also dangerous. This is mostly exposed to enable advanced configuration of the JSSEngine that isn't otherwise allowed by JSSSocket, and to facilitate the accept() method on JSSServerSocket.
      • getChannel

        public JSSSocketChannel getChannel()
        Get the underlying SocketChannel for this Socket.
        Overrides:
        getChannel in class java.net.Socket
        See Also:
        Socket.getChannel()
      • getInternalChannel

        protected JSSSocketChannel getInternalChannel()
        Helper to always return the channel for this socket, initializing it if it isn't yet created.
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Get a copy of an input stream for this Socket.
        Overrides:
        getInputStream in class java.net.Socket
        Throws:
        java.io.IOException
        See Also:
        Socket.getInputStream()
      • getOutputStream

        public java.io.OutputStream getOutputStream()
                                             throws java.io.IOException
        Get a copy of an output stream for this Socket.
        Overrides:
        getOutputStream in class java.net.Socket
        Throws:
        java.io.IOException
        See Also:
        Socket.getOutputStream()
      • setConsumedData

        public void setConsumedData​(java.io.InputStream consumed)
        Helper to inform this socket of data already consumed from the wrapped socket. This is provided to facilitate a SSLSocketFactory call which allows construction of SSLSocket instances from a non-SSL ServerSocket, allowing the application to check SNI information directly.
      • getAutoClose

        public boolean getAutoClose()
        Get the autoClose status of this socket, that is, whether or not its parent socket will be automatically closed.
      • setAutoClose

        public void setAutoClose​(boolean on)
        Set the autoClose status of this socket, that is, whether or not its parent socket will be automatically closed.
      • setHostname

        public void setHostname​(java.lang.String name)
        Set the hostname this client socket is connecting to, for HTTPS TLS certificate validation purposes.
        See Also:
        JSSEngine.setHostname(String)
      • setCertFromAlias

        public void setCertFromAlias​(java.lang.String alias)
                              throws java.lang.IllegalArgumentException
        Set the certificate this SSLSocket will utilize from an alias in the NSS DB.
        Throws:
        java.lang.IllegalArgumentException
        See Also:
        JSSEngine.setCertFromAlias(String)
      • setTrustManagers

        public void setTrustManagers​(javax.net.ssl.X509TrustManager[] xtms)
        Set the trust managers this SSLSocket will utilize to validate a peer's certificate.
        See Also:
        JSSEngine.setTrustManagers(X509TrustManager[])
      • setListeners

        public void setListeners​(java.util.Collection<? extends java.util.EventListener> listeners)
        Set the listeners this SSLSocket will fire on certain events.
        See Also:
        JSSEngine.setListeners(Collection)
      • getListeners

        public java.util.Collection<? extends java.util.EventListener> getListeners()
        Gets the current list of event listeners this SSLSocket will fire on certain events.
        See Also:
        JSSEngine.getListeners()
      • startHandshake

        public void startHandshake()
                            throws java.io.IOException
        Begin a handshake, blocking to completion; this will begin a new handshake when one has already been issued.
        Specified by:
        startHandshake in class javax.net.ssl.SSLSocket
        Throws:
        java.io.IOException
        See Also:
        SSLEngine.beginHandshake(), SSLSocket.startHandshake()
      • addHandshakeCompletedListener

        public void addHandshakeCompletedListener​(javax.net.ssl.HandshakeCompletedListener callback)
                                           throws java.lang.IllegalArgumentException
        Add a callback to fire on handshake completion.
        Specified by:
        addHandshakeCompletedListener in class javax.net.ssl.SSLSocket
        Throws:
        java.lang.IllegalArgumentException
        See Also:
        SSLSocket.addHandshakeCompletedListener(HandshakeCompletedListener)
      • notifyHandshakeCompletedListeners

        protected void notifyHandshakeCompletedListeners()
        Internal helper to fire callbacks on handshake completion.
      • removeHandshakeCompletedListener

        public void removeHandshakeCompletedListener​(javax.net.ssl.HandshakeCompletedListener callback)
                                              throws java.lang.IllegalArgumentException
        Remove a callback from firing on handshake completion.
        Specified by:
        removeHandshakeCompletedListener in class javax.net.ssl.SSLSocket
        Throws:
        java.lang.IllegalArgumentException
        See Also:
        SSLSocket.removeHandshakeCompletedListener(HandshakeCompletedListener)
      • getEnabledCipherSuites

        public java.lang.String[] getEnabledCipherSuites()
        Get the set of enabled cipher suites for this SSLSocket.
        Specified by:
        getEnabledCipherSuites in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getEnabledCipherSuites(), SSLSocket.getEnabledCipherSuites()
      • getSupportedCipherSuites

        public java.lang.String[] getSupportedCipherSuites()
        Get the set of supported cipher suites for this SSLSocket.
        Specified by:
        getSupportedCipherSuites in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getSupportedCipherSuites(), SSLSocket.getSupportedCipherSuites()
      • setEnabledCipherSuites

        public void setEnabledCipherSuites​(java.lang.String[] suites)
        Set the list of enabled cipher suites for this SSLSocket.
        Specified by:
        setEnabledCipherSuites in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.setEnabledCipherSuites(String[]), SSLSocket.setEnabledCipherSuites(String[])
      • getEnabledProtocols

        public java.lang.String[] getEnabledProtocols()
        Get the set of enabled protocol versions for this SSLSocket.
        Specified by:
        getEnabledProtocols in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getEnabledProtocols(), SSLSocket.getEnabledProtocols()
      • getSupportedProtocols

        public java.lang.String[] getSupportedProtocols()
        Get the set of supported protocol versions for this SSLSocket.
        Specified by:
        getSupportedProtocols in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getSupportedProtocols(), SSLSocket.getSupportedProtocols()
      • setEnabledProtocols

        public void setEnabledProtocols​(java.lang.String[] protocols)
        Set the list of enabled protocol versions for this SSLSocket.
        Specified by:
        setEnabledProtocols in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.setEnabledProtocols(String[]), SSLSocket.setEnabledProtocols(String[])
      • getEnableSessionCreation

        public boolean getEnableSessionCreation()
        Get whether or not this SSLSocket enables creation of new sessions.
        Specified by:
        getEnableSessionCreation in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getEnableSessionCreation(), SSLSocket.getEnableSessionCreation()
      • setEnableSessionCreation

        public void setEnableSessionCreation​(boolean enabled)
        Set whether or not this SSLSocket enables creation of new sessions.
        Specified by:
        setEnableSessionCreation in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.setEnableSessionCreation(boolean), SSLSocket.setEnableSessionCreation(boolean)
      • getHandshakeSession

        public javax.net.ssl.SSLSession getHandshakeSession()
        Get the initial session constructed during handshaking.
        Overrides:
        getHandshakeSession in class javax.net.ssl.SSLSocket
        See Also:
        SSLEngine.getHandshakeSession(), SSLSocket.getHandshakeSession()
      • getSession

        public javax.net.ssl.SSLSession getSession()
        Get the established session for this SSLSocket.
        Specified by:
        getSession in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getSession(), SSLSocket.getSession()
      • getUseClientMode

        public boolean getUseClientMode()
        Get whether or not this SSLSocket is handshaking as a client.
        Specified by:
        getUseClientMode in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getUseClientMode(), SSLSocket.getUseClientMode()
      • setUseClientMode

        public void setUseClientMode​(boolean client)
        Set whether or not this SSLSocket is handshaking as a client.
        Specified by:
        setUseClientMode in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.setUseClientMode(boolean), SSLSocket.setUseClientMode(boolean)
      • getWantClientAuth

        public boolean getWantClientAuth()
        Get whether or not this SSLSocket wants client authentication.
        Specified by:
        getWantClientAuth in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getWantClientAuth(), SSLSocket.getWantClientAuth()
      • setWantClientAuth

        public void setWantClientAuth​(boolean want)
        Set whether or not this SSLSocket wants client authentication.
        Specified by:
        setWantClientAuth in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.setWantClientAuth(boolean), SSLSocket.setWantClientAuth(boolean)
      • getNeedClientAuth

        public boolean getNeedClientAuth()
        Get whether or not this SSLSocket needs client authentication.
        Specified by:
        getNeedClientAuth in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getNeedClientAuth(), SSLSocket.getNeedClientAuth()
      • setNeedClientAuth

        public void setNeedClientAuth​(boolean need)
        Set whether or not this SSLSocket needs client authentication.
        Specified by:
        setNeedClientAuth in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.setNeedClientAuth(boolean), SSLSocket.setNeedClientAuth(boolean)
      • getSSLParameters

        public JSSParameters getSSLParameters()
        Get the configuration of this SSLSocket as a JSSParameters object.
        Overrides:
        getSSLParameters in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.getSSLParameters(), SSLSocket.getSSLParameters()
      • setSSLParameters

        public void setSSLParameters​(javax.net.ssl.SSLParameters params)
        Set the configuration of this SSLSocket from the given SSLParameters instance.
        Overrides:
        setSSLParameters in class javax.net.ssl.SSLSocket
        See Also:
        JSSEngine.setSSLParameters(SSLParameters), SSLSocket.setSSLParameters(SSLParameters)
      • connect

        public void connect​(java.net.SocketAddress endpoint)
                     throws java.io.IOException
        Overrides:
        connect in class java.net.Socket
        Throws:
        java.io.IOException
      • connect

        public void connect​(java.net.SocketAddress endpoint,
                            int timeout)
                     throws java.io.IOException
        Overrides:
        connect in class java.net.Socket
        Throws:
        java.io.IOException
      • bind

        public void bind​(java.net.SocketAddress bindpoint)
                  throws java.io.IOException
        Overrides:
        bind in class java.net.Socket
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.net.Socket
        Throws:
        java.io.IOException
      • shutdownInput

        public void shutdownInput()
                           throws java.io.IOException
        Overrides:
        shutdownInput in class java.net.Socket
        Throws:
        java.io.IOException
      • shutdownOutput

        public void shutdownOutput()
                            throws java.io.IOException
        Overrides:
        shutdownOutput in class java.net.Socket
        Throws:
        java.io.IOException
      • getInetAddress

        public java.net.InetAddress getInetAddress()
        Overrides:
        getInetAddress in class java.net.Socket
      • getLocalAddress

        public java.net.InetAddress getLocalAddress()
        Overrides:
        getLocalAddress in class java.net.Socket
      • getPort

        public int getPort()
        Overrides:
        getPort in class java.net.Socket
      • getLocalPort

        public int getLocalPort()
        Overrides:
        getLocalPort in class java.net.Socket
      • getLocalSocketAddress

        public java.net.SocketAddress getLocalSocketAddress()
        Overrides:
        getLocalSocketAddress in class java.net.Socket
      • getRemoteSocketAddress

        public java.net.SocketAddress getRemoteSocketAddress()
        Overrides:
        getRemoteSocketAddress in class java.net.Socket
      • getTcpNoDelay

        public boolean getTcpNoDelay()
                              throws java.net.SocketException
        Overrides:
        getTcpNoDelay in class java.net.Socket
        Throws:
        java.net.SocketException
      • setTcpNoDelay

        public void setTcpNoDelay​(boolean on)
                           throws java.net.SocketException
        Overrides:
        setTcpNoDelay in class java.net.Socket
        Throws:
        java.net.SocketException
      • getSoLinger

        public int getSoLinger()
                        throws java.net.SocketException
        Overrides:
        getSoLinger in class java.net.Socket
        Throws:
        java.net.SocketException
      • setSoLinger

        public void setSoLinger​(boolean on,
                                int linger)
                         throws java.net.SocketException
        Overrides:
        setSoLinger in class java.net.Socket
        Throws:
        java.net.SocketException
      • getSoTimeout

        public int getSoTimeout()
                         throws java.net.SocketException
        Overrides:
        getSoTimeout in class java.net.Socket
        Throws:
        java.net.SocketException
      • setSoTimeout

        public void setSoTimeout​(int timeout)
                          throws java.net.SocketException
        Overrides:
        setSoTimeout in class java.net.Socket
        Throws:
        java.net.SocketException
      • getOOBInline

        public boolean getOOBInline()
                             throws java.net.SocketException
        Overrides:
        getOOBInline in class java.net.Socket
        Throws:
        java.net.SocketException
      • setOOBInline

        public void setOOBInline​(boolean on)
                          throws java.net.SocketException
        Overrides:
        setOOBInline in class java.net.Socket
        Throws:
        java.net.SocketException
      • sendUrgentData

        public void sendUrgentData​(int data)
                            throws java.io.IOException
        Overrides:
        sendUrgentData in class java.net.Socket
        Throws:
        java.io.IOException
      • getSendBufferSize

        public int getSendBufferSize()
                              throws java.net.SocketException
        Overrides:
        getSendBufferSize in class java.net.Socket
        Throws:
        java.net.SocketException
      • setSendBufferSize

        public void setSendBufferSize​(int size)
                               throws java.net.SocketException
        Overrides:
        setSendBufferSize in class java.net.Socket
        Throws:
        java.net.SocketException
      • getReceiveBufferSize

        public int getReceiveBufferSize()
                                 throws java.net.SocketException
        Overrides:
        getReceiveBufferSize in class java.net.Socket
        Throws:
        java.net.SocketException
      • setReceiveBufferSize

        public void setReceiveBufferSize​(int size)
                                  throws java.net.SocketException
        Overrides:
        setReceiveBufferSize in class java.net.Socket
        Throws:
        java.net.SocketException
      • getKeepAlive

        public boolean getKeepAlive()
                             throws java.net.SocketException
        Overrides:
        getKeepAlive in class java.net.Socket
        Throws:
        java.net.SocketException
      • setKeepAlive

        public void setKeepAlive​(boolean on)
                          throws java.net.SocketException
        Overrides:
        setKeepAlive in class java.net.Socket
        Throws:
        java.net.SocketException
      • getTrafficClass

        public int getTrafficClass()
                            throws java.net.SocketException
        Overrides:
        getTrafficClass in class java.net.Socket
        Throws:
        java.net.SocketException
      • setTrafficClass

        public void setTrafficClass​(int tc)
                             throws java.net.SocketException
        Overrides:
        setTrafficClass in class java.net.Socket
        Throws:
        java.net.SocketException
      • getReuseAddress

        public boolean getReuseAddress()
                                throws java.net.SocketException
        Overrides:
        getReuseAddress in class java.net.Socket
        Throws:
        java.net.SocketException
      • setReuseAddress

        public void setReuseAddress​(boolean on)
                             throws java.net.SocketException
        Overrides:
        setReuseAddress in class java.net.Socket
        Throws:
        java.net.SocketException
      • isConnected

        public boolean isConnected()
        Overrides:
        isConnected in class java.net.Socket
      • isBound

        public boolean isBound()
        Overrides:
        isBound in class java.net.Socket
      • isClosed

        public boolean isClosed()
        Overrides:
        isClosed in class java.net.Socket
      • isInputShutdown

        public boolean isInputShutdown()
        Overrides:
        isInputShutdown in class java.net.Socket
      • isOutputShutdown

        public boolean isOutputShutdown()
        Overrides:
        isOutputShutdown in class java.net.Socket
      • setPerformancePreferences

        public void setPerformancePreferences​(int connectionTime,
                                              int latency,
                                              int bandwidth)
        Overrides:
        setPerformancePreferences in class java.net.Socket
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.net.Socket
      • setOption

        public <T> java.net.Socket setOption​(java.net.SocketOption<T> name,
                                             T value)
                                      throws java.io.IOException
        Overrides:
        setOption in class java.net.Socket
        Throws:
        java.io.IOException
      • getOption

        public <T> T getOption​(java.net.SocketOption<T> name)
                        throws java.io.IOException
        Overrides:
        getOption in class java.net.Socket
        Throws:
        java.io.IOException
      • supportedOptions

        public java.util.Set<java.net.SocketOption<?>> supportedOptions()
        Overrides:
        supportedOptions in class java.net.Socket