- PCa send a message to PCB that must do something with the received message (make take 1 or 2 seconds)
- Upon completion, PCB send a CONF message to PCa, just to say that everything went well or to provide some data.
- After receiving the CONF msg, PCa can go on with its tasks.
In order to accomplish this, I scripted what you can find below. But I am having problems.
Is it the wrong way to do it or my scripts have bugs?
Thanks.
Code: Select all
function SendToServer
write tLenght & comma & TheMessage to socket gSocket
wait 500 milliseconds with messages
--"ClientMessageReceived" read the size (first item) and do other reading pass
read from socket gSocket for 1 items with message "ClientMessageReceived"
--the idea here is that "ClientMessageReceived" has time to set the sRePlayReceived flag
repeat 9
if sRePlayReceived then
put false into sRePlayReceived
return true
end if
wait 500 milliseconds with messages
end repeat
return false
end SendToServer