SexScripts : issue with send/receive - https://ss.deviatenow.com:443/viewtopic.php?f=4&t=745 Page 1 of 1

issue with send/receive

lifeinplymouth [ Fri Mar 09, 2018 6:20 pm ]

Code:
def msg="hi\nhow are you"
show(msg)
send("xxx.msg",msg)
wait(5)
msg=receiveString("xxx.msg")
show(msg)


output is:

hi
how are you
<5 second wait>
hi

we loose anything after the \n when sending,
is there a way around that?

Re: issue with send/receive

doti [ Fri Mar 09, 2018 6:46 pm ]

This is not the normal behaviour. I'll look for this bug this evening or tomorow

Re: issue with send/receive

lifeinplymouth [ Fri Mar 09, 2018 7:04 pm ]

running on macOS if it helps

Re: issue with send/receive

cgut2001 [ Fri Mar 09, 2018 11:21 pm ]

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.

Re: issue with send/receive

doti [ Sun Mar 11, 2018 3:22 pm ]

It was indeed a bug on the server, corrected

Page 1 of 1 All times are UTC + 1 hour [ DST ]
https://ss.deviatenow.com:443/
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010, 2011