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
A sampler which understands Tcp requests.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final booleanstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final booleanstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplies(ConfigTestElement configElement) Does configElement apply to SamplerintintgetLabel()Returns a formatted string label describing this sampler Example output: Tcp://Tcp.nowhere.com/pub/README.txtbooleanintgetPort()intintbooleanInterrupt the current operation if possible.booleanbooleanObtains 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) voidvoidsetRequestData(String newRequestData) voidvoidsetSoLinger(String soLinger) voidsetTimeout(String newTimeout) voidCalled for each thread after all samples have been processed.voidCalled for each thread before starting sampling.Methods inherited from class 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, traversePropertyMethods inherited from class Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 Details
-
SERVER
- See Also:
-
PORT
- See Also:
-
FILENAME
- See Also:
-
CLASSNAME
- See Also:
-
NODELAY
- See Also:
-
TIMEOUT
- See Also:
-
TIMEOUT_CONNECT
- See Also:
-
REQUEST
- See Also:
-
RE_USE_CONNECTION
- See Also:
-
RE_USE_CONNECTION_DEFAULT
public static final boolean RE_USE_CONNECTION_DEFAULT- See Also:
-
CLOSE_CONNECTION
- See Also:
-
CLOSE_CONNECTION_DEFAULT
public static final boolean CLOSE_CONNECTION_DEFAULT- See Also:
-
SO_LINGER
- See Also:
-
EOL_BYTE
- See Also:
-
-
Constructor Details
-
TCPSampler
public TCPSampler()
-
-
Method Details
-
getUsername
-
getPassword
-
setServer
-
getServer
-
isReUseConnection
public boolean isReUseConnection() -
setCloseConnection
-
isCloseConnection
public boolean isCloseConnection() -
setSoLinger
-
getSoLinger
public int getSoLinger() -
setEolByte
-
getEolByte
public int getEolByte() -
setPort
-
getPort
public int getPort() -
setFilename
-
getFilename
-
setRequestData
-
getRequestData
-
setTimeout
-
getTimeout
public int getTimeout() -
setConnectTimeout
-
getConnectTimeout
public int getConnectTimeout() -
getNoDelay
public boolean getNoDelay() -
setClassname
-
getClassname
-
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
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:
-
threadFinished
public void threadFinished()Called for each thread after all samples have been processed.- Specified by:
threadFinishedin interfaceThreadListener- See Also:
-
applies
Description copied from class:AbstractSamplerDoes configElement apply to Sampler- Specified by:
appliesin interfaceConfigMergabilityIndicator- Overrides:
appliesin classAbstractSampler- Parameters:
configElement-ConfigTestElement- Returns:
- boolean
- See Also:
-
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.
-