当前位置:网站首页>JMeter socket connection sends data

JMeter socket connection sends data

2022-06-25 00:20:00 Dream_ xang

Jmeter-Socket Connect to send data

This article introduces the following through Jmeter establish Socket Connect , Send to server 16 Hexadecimal data .

To configure TCP Connect

One 、 establish TCP Sampler configuration
 Insert picture description here
Two 、 Configuration instructions
TCPClient classname:TCP There are three ways to enable sending :

  • TCPClientImpl: Text data , Default to this
  • BinaryTCPClientImpl: transmission 16 Hexadecimal data , Specify package terminator . such 16 The hexadecimal file will pass Jmeter GUI To convert .
  • LengthPrefixedBinaryTCPClientImpl: Front in packet 2 Bytes are the data length . Can be found in bin/jmeter.properties In profile tcp.binarylength.prefix.length Set up .

Target Server:TCP Fill in the server address in the sampler 、 port .
Connect: Set connection timeout .
Response: Set response timeout .
Re-use connection: Indicates that the connection is repeatedly used to send requests .
Close connection: It means that after sending this piece of data each time , Close the connection .
End of line(EOL) byte value: Terminator .

  • Intercept the last byte according to the server return value , Notice if it is 16 Base number , It should be two characters
    such as , In my project, the return value is changed to 16 The base case is as follows :
    7e80010005013819415186010103e7020000d47e
    So the last byte (8 position ) Should be 7e Conversion for 10 After the base number is 126, So in eol Set to 126.
    Be careful : The terminator is a byte ,16 The hexadecimal number is greater than 7F(127) after , The EOL The value is negative. . such as : If the last byte returned by the server is 80, Change from single byte to decimal -128,EOL The value at should be filled in -128,.

If TCP The request requires a user name / password , You can fill in the login configuration .
 Insert picture description here

establish TCP Connect

One 、 establish TCP Sampler
TCP The sampler has been configured , There is no need to fill in IP、PORT Equal parameter .

  • Be careful : If you need to use the same connection to send data repeatedly , Every TCP Sampler's Re-use connection All need to be checked .
     Insert picture description here
    Establish a channel 1:
     Insert picture description here
    Two 、 Send signature data
    Set to keep long connection , Set response timeout 2000ms.
     Insert picture description here
    send out 16 Hexadecimal text content , The response data terminator needs to be set , According to the response data, the last byte is converted to 10 Hexadecimal data .
     Insert picture description here
原网站

版权声明
本文为[Dream_ xang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210550590937.html

随机推荐