LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ClientTCPRead response buffer contains concatenated string of old responses

When using ClientTCPRead() the response buffer contains responses from several prior ClientTCPWrite() commands. That is, the most recent response is concatenated onto a string containing several prior reponses.

 

Is there a way to clear the response buffer after each ClientTCPRead() so that only the response from the most recent request appears in the response buffer?

 

What happens if I issue several ClientTCPWrite() statements before the server issues a response? Will all the responses be contenated into one extended response? If the answer is yes, then this would explain why my response buffer has multiple response messages. How do I wait for a response before issuing another request?

0 Kudos
Message 1 of 2
(2,952 Views)

The function basically reads the entire buffer and gives the output, If previous unread responses are there, they also being shown as concatenated strings. But you will find a termination character which separates different responses. You can parse the response string and read only the intended message. 

0 Kudos
Message 2 of 2
(2,943 Views)