Reading from Sockets
janschenkel at yahoo.com
Tue Apr 29 23:54:38 EDT 2008
--- rgould8 at aol.com wrote:
> If I have a webpage that has a link like this:
> <a href="127.0.0.1:77">Talk to Rev</a>
> and while that webpage in Safari has that link
> clicked, I'd like to have Revolution lurking in the
> background waiting for that click, can someone tell
> me what I'd need to add to this script?
> on openCard
> ? open socket "127.0.0.1:77"
> ? read from socket "127.0.0.1:77" with message
> end openCard
> on gotdata
> ? answer "got data from the Safari webpage!"
> ? close socket "127.0.0.1:77"
> end gotdata
> I'm just a little confused about whether I need to
> _continually_ do the "read socket" in a timer-loop,
> or if I can give it an infinite timeout.
> Right now, I don't get this to work at all, even
> when I click the link within 5 seconds, so I'm
> obviously missing something important.?
You can find the old MetaCard HTTP server example at:
While it only supports the 'GET' method, it's a great
start for loearning how any socket-based server should
be built. RevOnRockets was inspired by it, as well as
several custom embedded web servers (I've built a few
Hope this helped,
Quartam Reports & PDF Library for Revolution
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
More information about the Use-livecode