'How to send multiple messages from TCP server to TCP client?

In the scenario, the client sends a request to the server and the server will respond multi messages to the client. can do this with TCP protocol?

further: can do this at the same time? I researched about JMeter but it's sending from client to server

The purpose is to test the load performance for the client



Solution 1:[1]

As per documentation:

TCPClientImpl This implementation is fairly basic. When reading the response, it reads until the end of line byte, if this is defined by setting the property tcp.eolByte, otherwise until the end of the input stream.

So you have 2 options:

  • Either supply "End of line (EOL) byte value" and then TCP Sampler will stop reading when it finds the appropriate byte in the response data
  • Or leave it empty - in that case TCP Sampler will continue reading until server closes the connection or timeout occurs, whatever comes the first

If this is not something you're looking for you can write your own implementation of the org.apache.jmeter.protocol.tcp.sampler.TCPClient interface and create the class which will be doing what you need to do.

More information: How to Load Test TCP Protocol Services with JMeter

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T