Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCPSampler : Packet gets converted/corrupted #2520

Closed
asfimport opened this issue Aug 29, 2011 · 6 comments
Closed

TCPSampler : Packet gets converted/corrupted #2520

asfimport opened this issue Aug 29, 2011 · 6 comments

Comments

@asfimport
Copy link
Collaborator

Jignesh (Bug 51737):
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.

Severity: normal
OS: All

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Not exactly clear what the problem is here.

Can you provide a simple JMX file that shows the problem?

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
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 ?

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
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.

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
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:
#2520 - 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

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Date: Sat Feb 4 14:37:45 2012
New Revision: 1240509

URL: http://svn.apache.org/viewvc?rev=1240509&view=rev
Log:
#2520 - TCPSampler : Packet gets converted/corrupted

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Date: Sat Feb 4 15:01:11 2012
New Revision: 1240514

URL: http://svn.apache.org/viewvc?rev=1240514&view=rev
Log:
#2520 - 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant