Summary: | Unable to set TCP Sampler for individual samples | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Paul Offord <paul.offord> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.4 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
Paul Offord
2011-03-26 12:49:49 UTC
I fixed the problem by adding a single line of code to TCPSampler.java as follows: public SampleResult sample(Entry e)// Entry tends to be ignored ... { . . . } else { InputStream is = sock.getInputStream(); OutputStream os = sock.getOutputStream(); // *** FIXED BY ADDING THE FOLLOWING LINE sock.setSoTimeout(getTimeout()); String req = getRequestData(); // TODO handle filenames res.setSamplerData(req); protocolHandler.write(os, req); String in = protocolHandler.read(is); res.setResponseData(in, null); res.setDataType(SampleResult.TEXT); res.setResponseCodeOK(); res.setResponseMessage("OK"); //$NON-NLS-1$ isSuccessful = true; . . . This seems to fix the problem and I'm not getting any adverse effects. Soory this isn't written like a patch but I don't know how to do it Thanks. Finally, I've put the setSoTimeout() in getSocket() because this place is better for do this. I've also sets Nodelay option for each sampler. URL: http://svn.apache.org/viewvc?rev=1086424&view=rev Log: Bug 50977 - Unable to set TCP Sampler for individual samples Modified: jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java jakarta/jmeter/trunk/xdocs/changes.xml This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2478 |