In the URScript 3.12 documentation.
Under socket_read_string it reads the following:
By using the “prefix” and “suffix” it is also possible send multiple string to
the controller at once, because the suffix defines where the message
ends. E.g. sending “>hello<>world<” and calling this script function with
the prefix=“>” and suffix=“<”.
Does this mean that the function returns an array of strings delimited by prefix and suffix?
Or does it read the socket buffer until the first suffix is found, meaning you would be able to use “socket_read_string” repeatedly on one received packet to get all the message’s parts?
I find the wording very confusing too.
Can anyone clarify what this function does please?
What this does is actually set var_1 to “Hello” and var_2 to “World”. So basically with a single send from the server I am able to get set the value of multiple variables from that single server write. So just playing around I changed the command that was written back from the server to sock.write(">Hello<>World<>from<>node<") and then added two more variables and this is what I get now
Hope that helps clarify what is going on and I learned something new today myself!