Bug 44910 - TCP Sampler "isReUseConnection" issue.
TCP Sampler "isReUseConnection" issue.
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.3.1
PC All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-04-30 05:34 UTC by Dmitry Kudrenko
Modified: 2008-04-30 05:45 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Kudrenko 2008-04-30 05:34:30 UTC
I tested application using JMeter TCP Sampler. This application closes session
when TCP Socket is closed.

But when I use the isReUseConnection flag - new connection is started
but old socket doesn't closed until JMeter is not closed.

TCPSampler closes connection in the finally block in the "sample" method if isReUseConnection set. But it closes new connection from the map but old connection is never closed.

I think connection should be closed every time when new connection created in the getSocket(). I added closeSocket() method to the getSocket() method:

  ...
  try {    // line 141
	closeSocket();
	con = new Socket(getServer(), getPort());
  ...

and it works for me correctly.

Thank you.
-- 
Regards,
Dmitry Kudrenko
ARDAS group http://ardas.dp.ua
Comment 1 Sebb 2008-04-30 05:45:54 UTC
Good catch.

Fix applied to SVN:

URL: http://svn.apache.org/viewvc?rev=652380&view=rev
Log:
Bug 44910 - close previous socket (if any) in TCP Sampler