Open Socket With Messages

Bob Sneidar bobsneidar at iotecdigital.com
Mon Jul 6 22:21:51 CEST 2015


It doesn’t wait. It passes the wait for messages just fine. I am using wait for messages because that is what the dictionary says I should be doing if I need to wait for the connection to be made before proceeding, otherwise the script will just keep going, which is precisely what I do NOT want it to do.

Now if *ANY* livecode message will cause it to pass muster, then that is bad, because livecode is sending messages all the time.

In this case, I am only opening one socket so I don’t need to check which one.

I already went on to try getting the parameter and putting that instead of the literal “connected!”. Still the callback handler is not getting triggered. That is really the issue here. The result is empty indicating that there is no error, yet the callback handler is not getting triggered.

Bob S


On Jul 6, 2015, at 12:59 , Mike Bonner <bonnmike at gmail.com<mailto:bonnmike at gmail.com>> wrote:

A couple things.. Remove the wait for messages, its not needed and is
probably a bad idea.

Then, since you're opening a secure socket, you might need to specify with,
or without verification (depending on your needs of course)

Also, there is a parameter that is passed along with the message that
contains the socket id.

So on socketConnected should be "on socketConnected pSocketId"
at which point you know which socket has completed.  (Since multiple
sockets can be open, this way you know WHICH one just finished opening)
I'd recommend looking at internet_chat.rev if you haven't.  YOu can get it
by going to resources (button on the LC bar) and on the left under sample
projects, there it is.

I think the biggest issue though is wait for messages.  It'd just sit there
waiting for something, but it has no clue what.



More information about the use-livecode mailing list