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")
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.