How to mimic telnet session

RGould8 at RGould8 at
Mon Dec 29 11:50:16 EST 2003

I've been searching the Revolution archives, and I  think I'm close, 
but I need some assistance figuring out what I'm  missing.  

Basically, I need to mimic a telnet session in  Revolution.  
I need to send text commands to a server on the internet  via port 7777, 
and receive the data that comes back.

If I were  doing this manually, I'd type:

telnet 7777

and then  type "cmd=getAccessType"

and then the server responds  with

ISDN&4=33.6K, ISDN, V.90&5=33.6K, V.90&6=ISDN  Only&7=V.90

(you can try this as well, if you're on a live  connection)

Can anyone tell me what I'm missing in my code?   
When I click the button, it seems to send successfully, but I get nothing  

on mouseUp
open socket ""  
write "cmd=getAccessType"  & CRLF to socket  "" with message 
wait 3  seconds
read from socket "" for 80 with message  "gotData"
close socket ""
end  mouseUp

on callbackmsg data 
put "callback (the result) = "  & the result
end callbackmsg

on socketError
answer "got  an error"
end socketError

on gotData
put "databack (the  result) = " & the result
end  gotData

More information about the Use-livecode mailing list