Package org.mozilla.jss.ssl.javax
Class JSSSocket
- java.lang.Object
-
- java.net.Socket
-
- javax.net.ssl.SSLSocket
-
- org.mozilla.jss.ssl.javax.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.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
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()
-
-
-
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 classjava.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 classjava.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 classjava.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)
-
setKeyMaterials
public void setKeyMaterials(PK11Cert our_cert, PK11PrivKey our_key) throws java.lang.IllegalArgumentException
Set the certificate this SSLSocket will utilize from a certificate and its matching private key.- Throws:
java.lang.IllegalArgumentException
- See Also:
JSSEngine.setKeyMaterials(PK11Cert, PK11PrivKey)
-
setKeyManager
public void setKeyManager(javax.net.ssl.X509KeyManager km)
Set the KeyManager this SSLSocket will utilize to select a key.- See Also:
JSSEngine.setKeyManager(X509KeyManager)
-
setKeyManagers
public void setKeyManagers(javax.net.ssl.X509KeyManager[] xkms)
Set the key managers this SSLSocket will utilize to select a key.
-
setTrustManager
public void setTrustManager(JSSTrustManager tm)
Set the trust manager this SSLSocket will utilize to validate a peer's certificate.
-
setTrustManagers
public void setTrustManagers(javax.net.ssl.X509TrustManager[] xtms)
Set the trust managers this SSLSocket will utilize to validate a peer's certificate.
-
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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjavax.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 classjava.net.Socket
- Throws:
java.io.IOException
-
connect
public void connect(java.net.SocketAddress endpoint, int timeout) throws java.io.IOException
- Overrides:
connect
in classjava.net.Socket
- Throws:
java.io.IOException
-
bind
public void bind(java.net.SocketAddress bindpoint) throws java.io.IOException
- Overrides:
bind
in classjava.net.Socket
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.net.Socket
- Throws:
java.io.IOException
-
shutdownInput
public void shutdownInput() throws java.io.IOException
- Overrides:
shutdownInput
in classjava.net.Socket
- Throws:
java.io.IOException
-
shutdownOutput
public void shutdownOutput() throws java.io.IOException
- Overrides:
shutdownOutput
in classjava.net.Socket
- Throws:
java.io.IOException
-
getInetAddress
public java.net.InetAddress getInetAddress()
- Overrides:
getInetAddress
in classjava.net.Socket
-
getLocalAddress
public java.net.InetAddress getLocalAddress()
- Overrides:
getLocalAddress
in classjava.net.Socket
-
getPort
public int getPort()
- Overrides:
getPort
in classjava.net.Socket
-
getLocalPort
public int getLocalPort()
- Overrides:
getLocalPort
in classjava.net.Socket
-
getLocalSocketAddress
public java.net.SocketAddress getLocalSocketAddress()
- Overrides:
getLocalSocketAddress
in classjava.net.Socket
-
getRemoteSocketAddress
public java.net.SocketAddress getRemoteSocketAddress()
- Overrides:
getRemoteSocketAddress
in classjava.net.Socket
-
getTcpNoDelay
public boolean getTcpNoDelay() throws java.net.SocketException
- Overrides:
getTcpNoDelay
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setTcpNoDelay
public void setTcpNoDelay(boolean on) throws java.net.SocketException
- Overrides:
setTcpNoDelay
in classjava.net.Socket
- Throws:
java.net.SocketException
-
getSoLinger
public int getSoLinger() throws java.net.SocketException
- Overrides:
getSoLinger
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setSoLinger
public void setSoLinger(boolean on, int linger) throws java.net.SocketException
- Overrides:
setSoLinger
in classjava.net.Socket
- Throws:
java.net.SocketException
-
getSoTimeout
public int getSoTimeout() throws java.net.SocketException
- Overrides:
getSoTimeout
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setSoTimeout
public void setSoTimeout(int timeout) throws java.net.SocketException
- Overrides:
setSoTimeout
in classjava.net.Socket
- Throws:
java.net.SocketException
-
getOOBInline
public boolean getOOBInline() throws java.net.SocketException
- Overrides:
getOOBInline
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setOOBInline
public void setOOBInline(boolean on) throws java.net.SocketException
- Overrides:
setOOBInline
in classjava.net.Socket
- Throws:
java.net.SocketException
-
sendUrgentData
public void sendUrgentData(int data) throws java.io.IOException
- Overrides:
sendUrgentData
in classjava.net.Socket
- Throws:
java.io.IOException
-
getSendBufferSize
public int getSendBufferSize() throws java.net.SocketException
- Overrides:
getSendBufferSize
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setSendBufferSize
public void setSendBufferSize(int size) throws java.net.SocketException
- Overrides:
setSendBufferSize
in classjava.net.Socket
- Throws:
java.net.SocketException
-
getReceiveBufferSize
public int getReceiveBufferSize() throws java.net.SocketException
- Overrides:
getReceiveBufferSize
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setReceiveBufferSize
public void setReceiveBufferSize(int size) throws java.net.SocketException
- Overrides:
setReceiveBufferSize
in classjava.net.Socket
- Throws:
java.net.SocketException
-
getKeepAlive
public boolean getKeepAlive() throws java.net.SocketException
- Overrides:
getKeepAlive
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setKeepAlive
public void setKeepAlive(boolean on) throws java.net.SocketException
- Overrides:
setKeepAlive
in classjava.net.Socket
- Throws:
java.net.SocketException
-
getTrafficClass
public int getTrafficClass() throws java.net.SocketException
- Overrides:
getTrafficClass
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setTrafficClass
public void setTrafficClass(int tc) throws java.net.SocketException
- Overrides:
setTrafficClass
in classjava.net.Socket
- Throws:
java.net.SocketException
-
getReuseAddress
public boolean getReuseAddress() throws java.net.SocketException
- Overrides:
getReuseAddress
in classjava.net.Socket
- Throws:
java.net.SocketException
-
setReuseAddress
public void setReuseAddress(boolean on) throws java.net.SocketException
- Overrides:
setReuseAddress
in classjava.net.Socket
- Throws:
java.net.SocketException
-
isConnected
public boolean isConnected()
- Overrides:
isConnected
in classjava.net.Socket
-
isBound
public boolean isBound()
- Overrides:
isBound
in classjava.net.Socket
-
isClosed
public boolean isClosed()
- Overrides:
isClosed
in classjava.net.Socket
-
isInputShutdown
public boolean isInputShutdown()
- Overrides:
isInputShutdown
in classjava.net.Socket
-
isOutputShutdown
public boolean isOutputShutdown()
- Overrides:
isOutputShutdown
in classjava.net.Socket
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
- Overrides:
setPerformancePreferences
in classjava.net.Socket
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.net.Socket
-
setOption
public <T> java.net.Socket setOption(java.net.SocketOption<T> name, T value) throws java.io.IOException
- Overrides:
setOption
in classjava.net.Socket
- Throws:
java.io.IOException
-
getOption
public <T> T getOption(java.net.SocketOption<T> name) throws java.io.IOException
- Overrides:
getOption
in classjava.net.Socket
- Throws:
java.io.IOException
-
supportedOptions
public java.util.Set<java.net.SocketOption<?>> supportedOptions()
- Overrides:
supportedOptions
in classjava.net.Socket
-
-