socket woes

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Posts: 317
Joined: Tue Oct 28, 2008 1:23 am

socket woes

Post by adventuresofgreg » Wed Sep 30, 2015 1:03 pm

Howdy. Is there any reason that the following script won't result in server messages being collected in field "incoming" ? I'm not sure if my server message is formatted correctly or not, and If it is not, I may not even get a response from the server. But first, I would like to confirm that my socket connection, write and read from code is good.

global pSocket

on mouseUp
put "" into tIPaddress
put "7000" into tPort
put (tipaddress & ":" & tPort) into pSocket
open socket to pSocket with message "chatconnected"
end mouseUp

on chatconnected pSocket
put "we in man!" && pSocket
read from socket pSocket with message "chatReceived"
end chatconnected

on chatReceived pSocket, pData
put pdata & return after field "incoming"
read from socket pSocket with message "chatReceived"
end chatReceved

Post Reply

Return to “Talking LiveCode”