Page 1 of 1

socket woes

Posted: Wed Sep 30, 2015 1:03 pm
by adventuresofgreg
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