在 JMeter TCP Sampler 中出现错误,但我收到的数据很好
Getting an error in JMeter TCP Sampler, but I am receiving data well
我正在尝试通过 JMeter 与 C# 服务器建立 TCP 连接
从 C# 服务器接收 Base64 编码的数据并尝试在 JMeter 中对其进行解码
当前TCP采样器设置如下
TCPClient classname: TCPClientImpl
Timeouts Response: 1000
Re-use connection: true
Close connection: true
Set NoDelay: false
SO_LINGER: [EMPTY]
End of line(EOL) byte value: 03
通过添加 TCP 采样器连接到服务器时,从服务器收到以下错误消息。
org.apache.jmeter.protocol.tcp.sampler.ReadException: Error reading from server, bytes read: 116
Caused by: java.net.SocketTimeoutException: Read timed out
采样器结果
Thread Name:LoginTest 1-1
Sample Start:2020-11-12 14:24:54 KST
Load time:1079
Connect Time:0
Latency:71
Size in bytes:116
Sent bytes:0
Headers size in bytes:0
Body size in bytes:116
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):text
Response code:500
Response message:org.apache.jmeter.protocol.tcp.sampler.ReadException: Error reading from server, bytes read: 116
SampleResult fields:
ContentType:
DataEncoding: x-windows-949
但是,与错误消息不同的是,数据包数据是从实际服务器传送的。
当我添加JSR223 Listner并检查接收到的数据时,我确认正在正确接收所需的数据。
数据接收正常。为什么会出现错误?是 C# 服务器问题吗?
我不知道...
我自己解决了
原因是行尾字节值不正确。
因为它从C#服务器接收Base64编码的数据,
Base64 padding'=' 在流的末尾出现。
我输入61,'='的ASCII值作为End of line byte value,结果成功。
但我不确定这是否是正确的解决方案
如果有更合适的解决方案请告诉我
我正在尝试通过 JMeter 与 C# 服务器建立 TCP 连接 从 C# 服务器接收 Base64 编码的数据并尝试在 JMeter 中对其进行解码
当前TCP采样器设置如下
TCPClient classname: TCPClientImpl
Timeouts Response: 1000
Re-use connection: true
Close connection: true
Set NoDelay: false
SO_LINGER: [EMPTY]
End of line(EOL) byte value: 03
通过添加 TCP 采样器连接到服务器时,从服务器收到以下错误消息。
org.apache.jmeter.protocol.tcp.sampler.ReadException: Error reading from server, bytes read: 116
Caused by: java.net.SocketTimeoutException: Read timed out
采样器结果
Thread Name:LoginTest 1-1
Sample Start:2020-11-12 14:24:54 KST
Load time:1079
Connect Time:0
Latency:71
Size in bytes:116
Sent bytes:0
Headers size in bytes:0
Body size in bytes:116
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):text
Response code:500
Response message:org.apache.jmeter.protocol.tcp.sampler.ReadException: Error reading from server, bytes read: 116
SampleResult fields:
ContentType:
DataEncoding: x-windows-949
但是,与错误消息不同的是,数据包数据是从实际服务器传送的。
当我添加JSR223 Listner并检查接收到的数据时,我确认正在正确接收所需的数据。
数据接收正常。为什么会出现错误?是 C# 服务器问题吗?
我不知道...
我自己解决了
原因是行尾字节值不正确。
因为它从C#服务器接收Base64编码的数据, Base64 padding'=' 在流的末尾出现。 我输入61,'='的ASCII值作为End of line byte value,结果成功。
但我不确定这是否是正确的解决方案 如果有更合适的解决方案请告诉我