Telnet Session

Sarah Reichelt sarah.reichelt at gmail.com
Thu Jun 29 21:33:10 EDT 2006


> I have a cool new HD mpeg server to play with here that was sposta be
> serially controllable (what the clients wants) as the manufacturer
> told me before we bought the sucker, but they neglected to say that
> serial API will not be implemented until later this year. So the
> alternative is the barely functional telnet api via tcpip.
>
> Does anyone have some examples of setting up a telnet session via
> tcpip using rev?

Hi Jeff,

I would use Terminal first to establish the comms and work out what
commands you need to send and what data you expect to get back. To do
this, open the Terminal program (it's in Applications/Utilities) and
type "telnet " followed by the IP address of the server, and press
Return. Hopefully this will get you to where you can log in and do
stuff.

Once you have that worked out, you will need to implement the Rev side
of things, which you can do using sockets. I think Telnet uses port 23
by default, but there are other ports too, so you may need to check
that. Then you can use:
  open socket to serverIP & ":23"

Once connected, you can read from socket & write to socket. If you
want some examples of sockets, you are welcome to have a look at my
POP & SMTP libraries. They use different ports and different command
sets, but the basic techniques should be the same. You can find them
at <http://www.troz.net/Rev/libraries.php>.

Cheers,
Sarah

P.S. I've never done this, but I assume this is how it works :-)



More information about the use-livecode mailing list