org.apache.jmeter.protocol.tcp.sampler

## Interface TCPClient

- All Known Implementing Classes:
    AbstractTCPClient, BinaryTCPClientImpl, LengthPrefixedBinaryTCPClientImpl, TCPClientDecorator, TCPClientImpl

      public interface TCPClient

  Interface required by TCPSampler for TCPClient implementations.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCharset()` Get the charset.
    `byte` | `getEolByte()` Get the end-of-line/end-of-message byte.
    `java.lang.String` | `read(java.io.InputStream is)` Deprecated. since 3.3, implement `read(InputStream, SampleResult)` instead, will be removed in future version
    `java.lang.String` | `read(java.io.InputStream is, SampleResult sampleResult)`
    `void` | `setEolByte(int eolInt)` Set the end-of-line/end-of-message byte.
    `void` | `setupTest()` Invoked when the thread starts.
    `void` | `teardownTest()` Invoked when the thread ends
    `void` | `write(java.io.OutputStream os, java.io.InputStream is)`
    `void` | `write(java.io.OutputStream os, java.lang.String s)`

- - ### Method Detail

    - #### setupTest

          void setupTest()

      Invoked when the thread starts.

    - #### teardownTest

          void teardownTest()

      Invoked when the thread ends

    - #### write

          void write(java.io.OutputStream os,
                     java.io.InputStream is)
              throws java.io.IOException

      Parameters:
        `os` - - OutputStream for socket
        `is` - - InputStream to be written to Socket
      Throws:
        `java.io.IOException` - when writing fails

    - #### write

          void write(java.io.OutputStream os,
                     java.lang.String s)
              throws java.io.IOException

      Parameters:
        `os` - - OutputStream for socket
        `s` - - String to write
      Throws:
        `java.io.IOException` - when writing fails

    - #### read

          @Deprecated
          java.lang.String read(java.io.InputStream is)
                                     throws ReadException

      Deprecated. since 3.3, implement `read(InputStream, SampleResult)` instead, will be removed in future version
      Parameters:
        `is` - - InputStream for socket
      Returns:
        String read from socket
      Throws:
        `ReadException` - exception that can contain partial response (Response until error occurred)

    - #### read

          java.lang.String read(java.io.InputStream is,
                                SampleResult sampleResult)
                         throws ReadException

      Parameters:
        `is` - - InputStream for socket
        `sampleResult` - `SampleResult`
      Returns:
        String read from socket
      Throws:
        `ReadException` - exception that can contain partial response

    - #### getEolByte

          byte getEolByte()

      Get the end-of-line/end-of-message byte.
      Returns:
        Returns the eolByte.

    - #### getCharset

          java.lang.String getCharset()

      Get the charset.
      Returns:
        Returns the charset.

    - #### setEolByte

          void setEolByte(int eolInt)

      Set the end-of-line/end-of-message byte. If the value is out of range of a byte, then it is to be ignored.
      Parameters:
        `eolInt` - The value to set

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.