Can a Rev cgi "accept connections"?
Mark Schonewille
m.schonewille at economy-x-talk.com
Mon Jan 18 04:03:13 EST 2010
Hi Nicolas,
As far as RunRev is concerned, it is possible, but your web host may
not allow it.
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
TwistAWord supports Haiti. Buy a license for this word game at http://www.twistaword.net
and support the earthquake victims.
Op 18 jan 2010, om 09:54 heeft Nicolas Cueto het volgende geschreven:
> Why do I ask?
>
> Cause, after studying about sockets using Rev's "chat server/client"
> sample
> stack (thank you to Bill Vlahos for pointing it out), I'm now trying
> to get
> a Rev cgi script to act as the server (the script will be in my on-
> rev
> Rev-cgi folder).
>
> Unfortunately, what works locally isn't at all on the web.
>
> If it helps, here's the Rev cgi server-script and a snippet of the
> client
> stack:
>
>
> /////////////// Rev.cgi server
> script ////////////////////////////////
>
> #!MyRevEngine -ui
> on startup
> accept connections on port 1987 with message chatConnected
> end startup
>
> on chatConnected s -- s contains address and port of connecting
> computer
> read from socket s for 1 line
> put line 1 of it into tSocket
> put "Hello world" && tSocket into message
> write message to socket tSocket
> close socket tSocket
> end chatConnected
>
>
> /////////////////// client stack ///////////////////////////
> on mouseUp
> open socket to "myurl.com/cgi-bin/server.cgi:1987" with message
> "chatConnected"
> end mouseUp
>
> on chatConnected s
> put s into lChatSocket
> read from socket s with message chatReceived
> end chatConnected
>
> on chatReceived s,data
> put data & return after field "responses"
> read from socket s with message chatReceived
> end chatReceived
>
> //////////////////////////////////////////////////////////////////////////////
>
> Apologies if I'm asking for excessive hand-holding.
>
> Thanks.
>
> --
> Nicolas Cueto
More information about the use-livecode
mailing list