Bug 44910 - TCP Sampler "isReUseConnection" issue.
Summary: TCP Sampler "isReUseConnection" issue.
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.3.1
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2008-04-30 05:34 UTC by Dmitry Kudrenko
Modified: 2008-04-30 05:45 UTC (History)
0 users


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
	con = new Socket(getServer(), getPort());

and it works for me correctly.

Thank you.
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
Bug 44910 - close previous socket (if any) in TCP Sampler