Package org.apache.jmeter.util
Class SlowSSLSocket
- java.lang.Object
-
- java.net.Socket
-
- javax.net.ssl.SSLSocket
-
- org.apache.jmeter.util.SlowSSLSocket
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class SlowSSLSocket extends SSLSocket
"Slow" SSLsocket implementation to emulate dial-up modems etc WARNING: the class relies on overriding all superclass methods in order to apply them to the input socket. Any missing methods will access the superclass socket, which will probably be in the wrong state.
-
-
Constructor Summary
Constructors Constructor Description SlowSSLSocket(SSLSocket sock, int cps)Wrap an SSLSocket with slow input and output streams
-
Method Summary
-
Methods inherited from class javax.net.ssl.SSLSocket
getApplicationProtocol, getHandshakeApplicationProtocol, getHandshakeApplicationProtocolSelector, getHandshakeSession, getSSLParameters, setHandshakeApplicationProtocolSelector, setSSLParameters
-
Methods inherited from class java.net.Socket
getOption, setOption, setPerformancePreferences, setSocketImplFactory, supportedOptions
-
-
-
-
Constructor Detail
-
SlowSSLSocket
public SlowSSLSocket(SSLSocket sock, int cps)
Wrap an SSLSocket with slow input and output streams- Parameters:
sock- SSLSocket to be wrappedcps- characters per second to emulate
-
-
Method Detail
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Overrides:
getOutputStreamin classSocket- Throws:
IOException
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStreamin classSocket- Throws:
IOException
-
addHandshakeCompletedListener
public void addHandshakeCompletedListener(HandshakeCompletedListener arg0)
- Specified by:
addHandshakeCompletedListenerin classSSLSocket
-
getEnableSessionCreation
public boolean getEnableSessionCreation()
- Specified by:
getEnableSessionCreationin classSSLSocket
-
getEnabledCipherSuites
public String[] getEnabledCipherSuites()
- Specified by:
getEnabledCipherSuitesin classSSLSocket
-
getEnabledProtocols
public String[] getEnabledProtocols()
- Specified by:
getEnabledProtocolsin classSSLSocket
-
getNeedClientAuth
public boolean getNeedClientAuth()
- Specified by:
getNeedClientAuthin classSSLSocket
-
getSession
public SSLSession getSession()
- Specified by:
getSessionin classSSLSocket
-
getSupportedCipherSuites
public String[] getSupportedCipherSuites()
- Specified by:
getSupportedCipherSuitesin classSSLSocket
-
getSupportedProtocols
public String[] getSupportedProtocols()
- Specified by:
getSupportedProtocolsin classSSLSocket
-
getUseClientMode
public boolean getUseClientMode()
- Specified by:
getUseClientModein classSSLSocket
-
getWantClientAuth
public boolean getWantClientAuth()
- Specified by:
getWantClientAuthin classSSLSocket
-
removeHandshakeCompletedListener
public void removeHandshakeCompletedListener(HandshakeCompletedListener arg0)
- Specified by:
removeHandshakeCompletedListenerin classSSLSocket
-
setEnableSessionCreation
public void setEnableSessionCreation(boolean arg0)
- Specified by:
setEnableSessionCreationin classSSLSocket
-
setEnabledCipherSuites
public void setEnabledCipherSuites(String[] arg0)
- Specified by:
setEnabledCipherSuitesin classSSLSocket
-
setEnabledProtocols
public void setEnabledProtocols(String[] arg0)
- Specified by:
setEnabledProtocolsin classSSLSocket
-
setNeedClientAuth
public void setNeedClientAuth(boolean arg0)
- Specified by:
setNeedClientAuthin classSSLSocket
-
setUseClientMode
public void setUseClientMode(boolean arg0)
- Specified by:
setUseClientModein classSSLSocket
-
setWantClientAuth
public void setWantClientAuth(boolean arg0)
- Specified by:
setWantClientAuthin classSSLSocket
-
startHandshake
public void startHandshake() throws IOException- Specified by:
startHandshakein classSSLSocket- Throws:
IOException
-
bind
public void bind(SocketAddress bindpoint) throws IOException
- Overrides:
bindin classSocket- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSocket- Throws:
IOException
-
connect
public void connect(SocketAddress endpoint, int timeout) throws IOException
- Overrides:
connectin classSocket- Throws:
IOException
-
connect
public void connect(SocketAddress endpoint) throws IOException
- Overrides:
connectin classSocket- Throws:
IOException
-
getChannel
public SocketChannel getChannel()
- Overrides:
getChannelin classSocket
-
getInetAddress
public InetAddress getInetAddress()
- Overrides:
getInetAddressin classSocket
-
getKeepAlive
public boolean getKeepAlive() throws SocketException- Overrides:
getKeepAlivein classSocket- Throws:
SocketException
-
getLocalAddress
public InetAddress getLocalAddress()
- Overrides:
getLocalAddressin classSocket
-
getLocalPort
public int getLocalPort()
- Overrides:
getLocalPortin classSocket
-
getLocalSocketAddress
public SocketAddress getLocalSocketAddress()
- Overrides:
getLocalSocketAddressin classSocket
-
getOOBInline
public boolean getOOBInline() throws SocketException- Overrides:
getOOBInlinein classSocket- Throws:
SocketException
-
getReceiveBufferSize
public int getReceiveBufferSize() throws SocketException- Overrides:
getReceiveBufferSizein classSocket- Throws:
SocketException
-
getRemoteSocketAddress
public SocketAddress getRemoteSocketAddress()
- Overrides:
getRemoteSocketAddressin classSocket
-
getReuseAddress
public boolean getReuseAddress() throws SocketException- Overrides:
getReuseAddressin classSocket- Throws:
SocketException
-
getSendBufferSize
public int getSendBufferSize() throws SocketException- Overrides:
getSendBufferSizein classSocket- Throws:
SocketException
-
getSoLinger
public int getSoLinger() throws SocketException- Overrides:
getSoLingerin classSocket- Throws:
SocketException
-
getSoTimeout
public int getSoTimeout() throws SocketException- Overrides:
getSoTimeoutin classSocket- Throws:
SocketException
-
getTcpNoDelay
public boolean getTcpNoDelay() throws SocketException- Overrides:
getTcpNoDelayin classSocket- Throws:
SocketException
-
getTrafficClass
public int getTrafficClass() throws SocketException- Overrides:
getTrafficClassin classSocket- Throws:
SocketException
-
isConnected
public boolean isConnected()
- Overrides:
isConnectedin classSocket
-
isInputShutdown
public boolean isInputShutdown()
- Overrides:
isInputShutdownin classSocket
-
isOutputShutdown
public boolean isOutputShutdown()
- Overrides:
isOutputShutdownin classSocket
-
sendUrgentData
public void sendUrgentData(int data) throws IOException- Overrides:
sendUrgentDatain classSocket- Throws:
IOException
-
setKeepAlive
public void setKeepAlive(boolean on) throws SocketException- Overrides:
setKeepAlivein classSocket- Throws:
SocketException
-
setOOBInline
public void setOOBInline(boolean on) throws SocketException- Overrides:
setOOBInlinein classSocket- Throws:
SocketException
-
setReceiveBufferSize
public void setReceiveBufferSize(int size) throws SocketException- Overrides:
setReceiveBufferSizein classSocket- Throws:
SocketException
-
setReuseAddress
public void setReuseAddress(boolean on) throws SocketException- Overrides:
setReuseAddressin classSocket- Throws:
SocketException
-
setSendBufferSize
public void setSendBufferSize(int size) throws SocketException- Overrides:
setSendBufferSizein classSocket- Throws:
SocketException
-
setSoLinger
public void setSoLinger(boolean on, int linger) throws SocketException- Overrides:
setSoLingerin classSocket- Throws:
SocketException
-
setSoTimeout
public void setSoTimeout(int timeout) throws SocketException- Overrides:
setSoTimeoutin classSocket- Throws:
SocketException
-
setTcpNoDelay
public void setTcpNoDelay(boolean on) throws SocketException- Overrides:
setTcpNoDelayin classSocket- Throws:
SocketException
-
setTrafficClass
public void setTrafficClass(int tc) throws SocketException- Overrides:
setTrafficClassin classSocket- Throws:
SocketException
-
shutdownInput
public void shutdownInput() throws IOException- Overrides:
shutdownInputin classSocket- Throws:
IOException
-
shutdownOutput
public void shutdownOutput() throws IOException- Overrides:
shutdownOutputin classSocket- Throws:
IOException
-
-