open socket with message doesn't call the message
Posted: Sat Apr 30, 2011 6:08 am
Given the following:
For some reason the 'open socket...' doesn't want to move on to the 'on connected' handler. I have a breakpoint in 'on connected' and I never get there.
If I move the stuff in 'on connected' into the mouseup (commenting the 'with message' portion of the 'open socket') it works, but it seems better to have the connection broken out into its own handler.
So, once again, what am I missing?
Code: Select all
on mouseup
open socket to strSocketConnection with message "connected"
end mouseUp
on connected theHost
--connected so login
put fld "fldUsername" into strUsername
put the userPassword of fld "fldPassword" into strPassword
write "*LOGIN::" & strUsername & "::" & strPassword to socket theHost
set label of button "Connect" to "Disconnect"
read from socket theHost with message "readSomething"
end connected
If I move the stuff in 'on connected' into the mouseup (commenting the 'with message' portion of the 'open socket') it works, but it seems better to have the connection broken out into its own handler.
So, once again, what am I missing?