Hi lifeinplymouth,
it's just a wild guess about a possible cause of your problem.
The '\n' is cast into a newline (Code 0x0a) when generating the string.
If 'send()' does use get-variables this would conclude the request. When getting it back, only the 'hi' would be there.
You could check two things.
Change your code to
Code:
def msg="hi\\nhow are you"
show(msg)
send("xxx.msg",msg)
wait(5)
msg=receiveString("xxx.msg")
show(msg)
In this case '\\n' would be cast into '\n' on the first string-assignment. So you should see a '\n' in the screen output. When you get the string back from the server, this '\n' should in my opinion be replaced by a true newline, so you should have a linebreak after 'hi'
If this works, you could check, if urlencoding your string helps. Off yourse you have to decode the string when you get it back. For this change your code to
Code:
def msg="hi\nhow are you"
show(msg)
msg = URLEncoder.encode(msg)
send("xxx.msg",msg)
wait(5)
msg=URLDecoder.decode(receiveString("xxx.msg"))
show(msg)
I'd like to hear if this did the trick.