How to use socket commands and function in a .irev script

Jim Ault jimaultwins at yahoo.com
Sun Sep 20 09:55:26 EDT 2009


On Sep 19, 2009, at 5:16 PM, Sarah Reichelt wrote:

> On Sun, Sep 20, 2009 at 9:20 AM, Jérôme Rosat <jrosat at mac.com> wrote:
>> Hi all,
>>
>> Is it possible to use socket commands and functions in a .irev  
>> script on a
>> on-rev serveur ?
>
>
> I just tested it and you can see the script & the result at
> <http://www.troz.net/onrev/samples/various.irev>.
> Trying to open a socket doesn't give an error but it doesn't seem to
> do anything.
> Trying with a callback doesn't trigger the callback either, it's like
> the open socket command just disappears.
> The docs list "open socket" as being available for desktop, server &
> web, but the functionality isn't there. Maybe this is temporary.

Programs and scripts running on a web server are running under Apache,  
which has environment variables set when it loads.  I don't know of a  
way that a process running in Apache can open and close sockets  
between processes.  Opening and using sockets to the network is done  
all the time.

Jim Bufalini correctly mentions the POST command as a way of using  
port 80, a default for Apache.
I think you would have to modify the httpd.conf file and tell Apache  
to listen on those ports.
One catch to this is that any program or script that is opened in  
Apache would be working with that port.

One serious difficulty with this is that Apache will launch a script,  
run it, then clear that memory.  The next request starts a new  
instance of the script.  This is how multiple users can access the  
same 'web page' and see it as their own session.  The process in  
Apache dies after the page is sent to the browser, thus there is no  
running program in Apache to receive the packets sent.

Basically, everything on a web server is accessed by telling Apache  
what you want and how you want it.

I would like to learn more about On-Rev surprising features and  
limitations so feel free to jump in if my comments are not telling the  
whole story.

Jim Ault
Las Vegas






More information about the use-livecode mailing list