Class TCPSampler
- java.lang.Object
-
- org.apache.jmeter.testelement.AbstractTestElement
-
- org.apache.jmeter.samplers.AbstractSampler
-
- org.apache.jmeter.protocol.tcp.sampler.TCPSampler
-
- All Implemented Interfaces:
Serializable,Cloneable,ConfigMergabilityIndicator,Searchable,Interruptible,Sampler,TestElement,ThreadListener
public class TCPSampler extends AbstractSampler implements ThreadListener, Interruptible
A sampler which understands Tcp requests.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLASSNAMEstatic StringCLOSE_CONNECTIONstatic booleanCLOSE_CONNECTION_DEFAULTstatic StringEOL_BYTEstatic StringFILENAMEstatic StringNODELAYstatic StringPORTstatic StringRE_USE_CONNECTIONstatic booleanRE_USE_CONNECTION_DEFAULTstatic StringREQUESTstatic StringSERVERstatic StringSO_LINGERstatic StringTIMEOUTstatic StringTIMEOUT_CONNECT-
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
-
Constructor Summary
Constructors Constructor Description TCPSampler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapplies(ConfigTestElement configElement)Does configElement apply to SamplerStringgetClassname()intgetConnectTimeout()intgetEolByte()StringgetFilename()StringgetLabel()Returns a formatted string label describing this sampler Example output: Tcp://Tcp.nowhere.com/pub/README.txtbooleangetNoDelay()StringgetPassword()intgetPort()StringgetRequestData()StringgetServer()intgetSoLinger()intgetTimeout()StringgetUsername()booleaninterrupt()Interrupt the current operation if possible.booleanisCloseConnection()booleanisReUseConnection()SampleResultsample(Entry e)Obtains statistics about the given Entry, and packages the information into a SampleResult.voidsetClassname(String classname)voidsetCloseConnection(String close)voidsetConnectTimeout(String newTimeout)voidsetEolByte(String eol)voidsetFilename(String newFilename)voidsetPort(String newFilename)voidsetRequestData(String newRequestData)voidsetServer(String newServer)voidsetSoLinger(String soLinger)voidsetTimeout(String newTimeout)voidthreadFinished()Called for each thread after all samples have been processed.voidthreadStarted()Called for each thread before starting sampling.-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jmeter.testelement.TestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
-
-
-
Field Detail
-
SERVER
public static final String SERVER
- See Also:
- Constant Field Values
-
PORT
public static final String PORT
- See Also:
- Constant Field Values
-
FILENAME
public static final String FILENAME
- See Also:
- Constant Field Values
-
CLASSNAME
public static final String CLASSNAME
- See Also:
- Constant Field Values
-
NODELAY
public static final String NODELAY
- See Also:
- Constant Field Values
-
TIMEOUT
public static final String TIMEOUT
- See Also:
- Constant Field Values
-
TIMEOUT_CONNECT
public static final String TIMEOUT_CONNECT
- See Also:
- Constant Field Values
-
REQUEST
public static final String REQUEST
- See Also:
- Constant Field Values
-
RE_USE_CONNECTION
public static final String RE_USE_CONNECTION
- See Also:
- Constant Field Values
-
RE_USE_CONNECTION_DEFAULT
public static final boolean RE_USE_CONNECTION_DEFAULT
- See Also:
- Constant Field Values
-
CLOSE_CONNECTION
public static final String CLOSE_CONNECTION
- See Also:
- Constant Field Values
-
CLOSE_CONNECTION_DEFAULT
public static final boolean CLOSE_CONNECTION_DEFAULT
- See Also:
- Constant Field Values
-
SO_LINGER
public static final String SO_LINGER
- See Also:
- Constant Field Values
-
EOL_BYTE
public static final String EOL_BYTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUsername
public String getUsername()
-
getPassword
public String getPassword()
-
setServer
public void setServer(String newServer)
-
getServer
public String getServer()
-
isReUseConnection
public boolean isReUseConnection()
-
setCloseConnection
public void setCloseConnection(String close)
-
isCloseConnection
public boolean isCloseConnection()
-
setSoLinger
public void setSoLinger(String soLinger)
-
getSoLinger
public int getSoLinger()
-
setEolByte
public void setEolByte(String eol)
-
getEolByte
public int getEolByte()
-
setPort
public void setPort(String newFilename)
-
getPort
public int getPort()
-
setFilename
public void setFilename(String newFilename)
-
getFilename
public String getFilename()
-
setRequestData
public void setRequestData(String newRequestData)
-
getRequestData
public String getRequestData()
-
setTimeout
public void setTimeout(String newTimeout)
-
getTimeout
public int getTimeout()
-
setConnectTimeout
public void setConnectTimeout(String newTimeout)
-
getConnectTimeout
public int getConnectTimeout()
-
getNoDelay
public boolean getNoDelay()
-
setClassname
public void setClassname(String classname)
-
getClassname
public String getClassname()
-
getLabel
public String getLabel()
Returns a formatted string label describing this sampler Example output: Tcp://Tcp.nowhere.com/pub/README.txt- Returns:
- a formatted string label describing this sampler
-
sample
public SampleResult sample(Entry e)
Description copied from interface:SamplerObtains statistics about the given Entry, and packages the information into a SampleResult.
-
threadStarted
public void threadStarted()
Description copied from interface:ThreadListenerCalled for each thread before starting sampling. WARNING: this is called before any Config test elements are processed, so any properties they define will not have been merged in yet.- Specified by:
threadStartedin interfaceThreadListener- See Also:
JMeterThread.threadStarted()
-
threadFinished
public void threadFinished()
Called for each thread after all samples have been processed.- Specified by:
threadFinishedin interfaceThreadListener- See Also:
JMeterThread.threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)
-
applies
public boolean applies(ConfigTestElement configElement)
Description copied from class:AbstractSamplerDoes configElement apply to Sampler- Specified by:
appliesin interfaceConfigMergabilityIndicator- Overrides:
appliesin classAbstractSampler- Parameters:
configElement-ConfigTestElement- Returns:
- boolean
- See Also:
AbstractSampler.applies(org.apache.jmeter.config.ConfigTestElement)
-
interrupt
public boolean interrupt()
Description copied from interface:InterruptibleInterrupt the current operation if possible.- Specified by:
interruptin interfaceInterruptible- Returns:
trueif there was an operation to interrupt.
-
-