+

Search Tips   |   Advanced Search


Add a socket receive element

You can manually add a socket receive element to a socket API performance test. In a performance test, socket receive elements describe how data is received over a connection. A socket receive element relates to a specific socket connection.

To add a socket receive element to a performance test:

  1. Open the performance test in the test editor.

  2. In the Test Contents area of the test editor, right-click the test node, and click Add > Socket Receive.

  3. In the Test Element Details section, click Change and select the socket connection that to receive data from. You can specify a Think Time delay before the test establishes the connection.

  4. Specify the End Policy. This specifies when the receive element stops receiving data and the test resumes:

    • Detects inactivity: The receive action stops when no bytes are received from the connection after a delay specified in Inactivity threshold (in milliseconds). After this delay, the remote computer has finished sending the response and is considered inactive. This is the default setting.

    • Receives exact number of bytes: The receive action stops when the recorded number of bytes is received. Specify a Timeout (in seconds) after which the receive action produces an error in the test log, if the correct number of bytes is not received. If Link data size is enabled, the receive action expects the number of bytes displayed in the Data area. If Link data size is disabled, the receive action expects the number of bytes displayed in Bytes.

    • Receives until end of stream: The receive action stops when the connection is closed by the remote computer. If Accepts empty response is selected, then the reception of a single byte is not required and the Response Timeout is ignored. Specify a Timeout (in seconds) after which the receive action produces an error in the test log, if the correct number of bytes is not received.

    • Matches a string: The receive action stops when a specified sequence of bytes is received. Specify a Timeout (in seconds) after which the receive action produces an error in the test log, if the correct number of bytes is not received.

    • Recognizes a regular expression: The receive action stops when a sequence of bytes that matches a regular expression is received. Specify a Timeout (in seconds) after which the receive action produces an error in the test log, if the correct number of bytes is not received.

  5. In the Data area, type the data that you expect to receive. By default, data is sent as 7-bit alphanumeric characters.

    To specify hexadecimal bytes, prefix the data with \x, for example: \x00\xff.


Related reference

  • Socket receive details