Seems there is a way, first Google hit on "jmeter socket testing":
Mar 05 2016
At the moment the only easy way to implement WebSocket testing with
JMeter is to use JMeter WebSocket Sampler by Maciej Zaleski. It's the
only RFC6455-compliant extension which supports reusing one TCP
session and it is easy to install and use.
failureMessage in the .jtl results file is applicable only for Assertions, if you're looking for a way to create a custom file having only response message and response data the easiest way is going for Flexible File Writer, the basic configuration would look like:
You can install Flexible File Writer using JMeter Plugins Manager:
I would suggest using a JSR223 post processor, where you will need to do a little scripting to get what you need to save as a CSV file. Here is basic pseudo-code to help with this.
//use PREV to get response data from previous sampler
//format this data (remove commas) and output to CSV file
outLog.write(csvResponse + "\n")
JMeter threads are absolutely independent, their context (session state, variables, etc) are stored locally hence each thread represents an individual virtual user.
Each thread executes samplers upside down (or according to Logic Controllers), this way you can pass the variables from one request to another within one thread
As you can see in below example ...