Bug 51737 - TCPSampler : Packet gets converted/corrupted
Summary: TCPSampler : Packet gets converted/corrupted
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-29 11:10 UTC by Jignesh
Modified: 2012-02-04 15:03 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jignesh 2011-08-29 11:10:27 UTC
Hi,

I am creating load test for a Window service application.
Packets are sent at socket.
But some packets gets converted.
Packets are being sent using TCP sampler

It is sent in ANSI form.
The problem is that 8F and 90 (In Hex format) is interpreted/sent as 3F and the packet gets corrupted. Also a lot of zeroes get appended in the end. 

Some packets are running fine but some packets get converted.
Comment 1 Sebb 2011-09-17 00:54:13 UTC
Not exactly clear what the problem is here.

Can you provide a simple JMX file that shows the problem?
Comment 2 Philippe Mouawad 2012-02-04 13:48:59 UTC
Hello,
Analyzing code of TCPClientImpl , it does conversion from byte array to String without setting any charset, so file.encoding of JVM will be used.

This may explain issues mentionned here with ANSI (Windows-1252) charset, although HEX is mentionned.

Shouldn't we add a field to input charset ?
Comment 3 Sebb 2012-02-04 14:08:56 UTC
Both reading and writing use the default charset, because they both convert between byte and string.

The simplest would be to add a property to control the encoding (as is done for the eolByte); this should be stored in the sample result as well.
Comment 4 Philippe Mouawad 2012-02-04 14:36:36 UTC
Fixed if org.apache.jmeter.protocol.tcp.sampler.TCPClientImpl was used as Implementation.

Date: Sat Feb  4 14:32:42 2012
New Revision: 1240507

URL: http://svn.apache.org/viewvc?rev=1240507&view=rev
Log:
Bug 51737 - TCPSampler : Packet gets converted/corrupted

Modified:
   jmeter/trunk/bin/jmeter.properties
   jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
   jmeter/trunk/xdocs/changes.xml
Comment 5 Philippe Mouawad 2012-02-04 14:41:24 UTC
Date: Sat Feb  4 14:37:45 2012
New Revision: 1240509

URL: http://svn.apache.org/viewvc?rev=1240509&view=rev
Log:
Bug 51737 - TCPSampler : Packet gets converted/corrupted
Comment 6 Philippe Mouawad 2012-02-04 15:03:50 UTC
Date: Sat Feb  4 15:01:11 2012
New Revision: 1240514

URL: http://svn.apache.org/viewvc?rev=1240514&view=rev
Log:
Bug 51737 - TCPSampler : Packet gets converted/corrupted
Added encoding to SampleResult

Modified:
   jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/AbstractTCPClient.java
   jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClient.java
   jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
   jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
Comment 7 The ASF infrastructure team 2022-09-24 20:37:46 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2520