Open Socket With Messages

Mike Bonner bonnmike at gmail.com
Mon Jul 6 15:59:50 EDT 2015


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.


On Mon, Jul 6, 2015 at 1:36 PM, Bob Sneidar <bobsneidar at iotecdigital.com>
wrote:

> Hi all.
>
> I am trying to use open socket like this:
>
>          put aConnection["dbhost"] & ":" & aConnection["dbport"] into
> theSocket
>          open secure socket to theSocket with message socketConnected
>          wait for messages
>          put the openSockets into theOpenSockets
>          close socket theSocket
>
> I have this handler in the same script:
> on socketConnected
>    -- callBack for open socket commands
>    put "connected!"
> end socketConnected
>
> The problem is, socketConnected never gets called. The connection works
> because theOpenSockets contains the connection as it should, but I never
> get the callback. What am I missing?
>
> Bob S
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list