Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use jmeter tcp sampler

Shulou Source: shulou.com Published: 2022-06-03 02:59:28 09月28日 Update

Jmeter video course address: https://edu.51cto.com/course/14305.html

Introduction of tcp sampler

Official TCP document: https://wiki.apache.org/jmeter/UserManual/Reference/TcpSampler. This is the best material we can learn. But it's a pity that no one likes to watch.

To put it simply, the use of the tcp sampler is basically the same as the HTTP request process, which is to fill in the necessary information after the sampler is established. The figure below is as follows

Fill in the introduction of the parameters

As in the above picture, basically we should pay attention to several points in the red box, and we will make an introduction below.

There are three settings for TCPClient classname:

TCPClientImpl: text data

BinaryTCPClientImpl: transmits binary data, specifying the package Terminator.

LengthPrefixedBinaryTCPClientImpl: the first two bytes in a packet are data lengths. Tcp.binarylength.prefix.length settings can be set in the bin/jmeter.properties configuration file.

The data of tcp is mostly binary or so, so the second setting is usually chosen for convenience. So fill in org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl

Server ip and port: there should be no need to say more, just fill in according to the actual situation

Text to be sent: here is the hexadecimal data, some friends may ask where to get this data! Grab the bag and get it, of course. You can use wireshark to do it, similar to the following picture (a picture found on the Internet)

This is probably what happens after the view result tree is established (the picture found on the network)

If it helps you, retweet + like = support

Tags: Data that is sampler binary text necessary above below no information parameters available in address byte official actual situation effect file document Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MySQL Linux MariaDB Apple