Class TCPSampler

All Implemented Interfaces:
Serializable, Cloneable, ConfigMergabilityIndicator, Searchable, Interruptible, Sampler, org.apache.jmeter.testelement.TestElement, ThreadListener

public class TCPSampler extends AbstractSampler implements ThreadListener, Interruptible
A sampler which understands Tcp requests.
See Also:
  • Field Details

  • Constructor Details

    • TCPSampler

      public TCPSampler()
  • Method Details

    • 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: Sampler
      Obtains statistics about the given Entry, and packages the information into a SampleResult.
      Specified by:
      sample in interface Sampler
      Parameters:
      e - the Entry (TODO seems to be unused)
      Returns:
      information about the sample
    • threadStarted

      public void threadStarted()
      Description copied from interface: ThreadListener
      Called 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. See org.apache.jmeter.threads.JMeterThread#threadStarted()
      Specified by:
      threadStarted in interface ThreadListener
    • threadFinished

      public void threadFinished()
      Called for each thread after all samples have been processed. See org.apache.jmeter.threads.JMeterThread#threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)
      Specified by:
      threadFinished in interface ThreadListener
    • applies

      public boolean applies(ConfigTestElement configElement)
      Description copied from class: AbstractSampler
      Does configElement apply to Sampler
      Specified by:
      applies in interface ConfigMergabilityIndicator
      Overrides:
      applies in class AbstractSampler
      Parameters:
      configElement - ConfigTestElement
      Returns:
      boolean
      See Also:
    • interrupt

      public boolean interrupt()
      Description copied from interface: Interruptible
      Interrupt the current operation if possible.
      Specified by:
      interrupt in interface Interruptible
      Returns:
      true if there was an operation to interrupt.