Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TCP Sampler in jmeter to test client-server

 
david kline
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im trying to load-test a server i wrote.
a client basically connects to the server via tcp (ServerSocket on the server) and sends a line of text (eg. "david") the connection is then closed without the server returning any reply to the client.

When testing in jmeter, i do the following:

- create new thread group
- create new TCP Sampler

enter the necessary details, and start.

The server is run on one machine on a network, and jmeter is run on another machine on the network.

Normally, when the server runs, and a client connects - the server displays the text that was received from the client.

When i run jmeter to test - i dont get any of the 'expected text' on the server.

What am I doing wrong?

Any help would be much appreciated.
Thanks in advance.

[ July 06, 2006: Message edited by: david kline ]
[ July 06, 2006: Message edited by: david kline ]
 
david kline
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured out the problem is that the TCP Sampler does not give an END-OF-LINE message after sending the text.

My server therefore waits to receive an end of line from it.

How can I get over this problem efficiently?

Thanks
[ July 06, 2006: Message edited by: david kline ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you simply need to include the newline in the test data itself?
 
david kline
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And thats what it was!
Thanks!
 
david kline
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And now i have a new problem - the looop doesnt seem to loop.

For example - I set 100 threads to run. And a loop forever. What i get is 100 threads connecting to my server, but after that, i dont get any further connections.

from what i understand, the 100 threads should attempt to connect again after the connection is closed - if set to loop forever, no?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from what i understand, the 100 threads should attempt to connect again after the connection is closed - if set to loop forever, no?

That depends entirely on the way your run() method is coded. My crystal ball is in the shop for the 10,000 vision checkup so I can't see your run method from here.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic