You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Markus Obermann <ma...@yahoo.de.INVALID> on 2020/10/02 16:31:42 UTC

TCP Sampler and linux nc

Hi,
I'm using JMeter 5.3.
I start a netcat session on my localhost like this: nc -l 15000
Now in JMeter i put a TCP-Sampler with a text and want to sent this to localhost:15000Doing so i see that JMeter sends the text to my localhost - but - it does not terminate. It is waiting for the EOL byte value.
Well i then put for the EOL the value 10 (which is \n) and start again.Now after recv. the data i had to press enter which will send the EOL Byte to JMeter.

So basically i can send TCP data - but i have to press enter every time to send the EOL back to jmeter - right?How can i avoid it?
I tried some other options like "close connection" or set a timeout for the reponse. But no success.
Can anyone help?It can't be so hard to send TCP-Data to a nc listener to localhost right?
Well what i can do right now is something "stupid".I can do an os process sampler in JMeter and just let execute the nc command to send my text to my localhost. But i dont want to use os-sampler like this to be honest i can do a bash "one line" skript fot this insted of jmeter os-sampler. 

Re: TCP Sampler and linux nc

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 02.10.20 um 18:31 schrieb Markus Obermann:
> Hi,
> I'm using JMeter 5.3.
> I start a netcat session on my localhost like this: nc -l 15000
> Now in JMeter i put a TCP-Sampler with a text and want to sent this to localhost:15000Doing so i see that JMeter sends the text to my localhost - but - it does not terminate. It is waiting for the EOL byte value.
> Well i then put for the EOL the value 10 (which is \n) and start again.Now after recv. the data i had to press enter which will send the EOL Byte to JMeter.
>
> So basically i can send TCP data - but i have to press enter every time to send the EOL back to jmeter - right?How can i avoid it?
> I tried some other options like "close connection" or set a timeout for the reponse. But no success.
> Can anyone help?It can't be so hard to send TCP-Data to a nc listener to localhost right?
> Well what i can do right now is something "stupid".I can do an os process sampler in JMeter and just let execute the nc command to send my text to my localhost. But i dont want to use os-sampler like this to be honest i can do a bash "one line" skript fot this insted of jmeter os-sampler. 

Have I understood it correctly, that you want to simulate a server, that
doesn't respond to you client?

The "pressing enter" on the the netcat side is basically sending the
response. If you don't want to wait for an answer, you can specify a
timeout for the response (I tested it with 100, which is a tenth of a a
second, and it worked).

I left the default settings on all fields except "Text to send" and
"Timeouts > Response". I tested on Ubuntu 20.04 with JMeter from trunk
(should not really matter, which version) and Java 14.

Felix

>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org