How to mimic telnet session
Dar Scott
dsc at swcp.com
Mon Dec 29 15:01:30 EST 2003
On Monday, December 29, 2003, at 11:58 AM, RGould8 at aol.com wrote:
> Thanks for your advice on tweaking my code to do a telnet session.
> I feel like a dunce today, but I'm still not getting any data back.
> Did I mis-type somthing, or misunderstand where the handlers should
> go?
This is looking pretty good, but...
>
> on mouseUp
> put EMPTY into msg
> open socket "dins.gte.net:7777"
> write "cmd=getAccessType" & CRLF to socket "dins.gte.net:7777" with
> message
> "callbackmsg"
> put "callback (the result) = " & the result & LF after msg
> wait 3 seconds
> read from socket "dins.gte.net:7777" until empty with message
> "gotData"
> put "read (the result) = " & the result & LF after msg
> put "databack (the data) = " & it & LF after msg
You don't need the above line and the 'with message' at the same time.
You can try taking off the 'with message' and see if the above line
reports anything.
> close socket "dins.gte.net:7777"
> end mouseUp
>
>
> on callbackmsg data
> put "callback" & the result & LF after msg
put "callback" & LF after msg
> end callbackmsg
>
> on socketError parm
> put "got an error " & parm & LF after msg
> end socketError
>
> on gotData socketID data
> put "from gotData hander (the data) = " & data & LF after msg
Do you get this printed out at all? If so, try upping the delay.
> end gotData
The entries in the message box from the callbacks will come after the
ones in the mouseUp handler.
Dar Scott
****************************************
Dar Scott Consulting
http://www.swcp.com/dsc/
Programming Services
****************************************
More information about the use-livecode
mailing list