comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: IDL on the NET(ION) Anybody used it?

Re: IDL on the NET(ION) Anybody used it?
type: item
description: Peter Brooker <ra5589@email.sps.mot.com> wrote: > Does anybody have experience with this? I want to create a fairly simple > modeling program that could be accessed through the net. The program > will display a multiline graph that will change as the user changes > inputs. I haven't used it, but, I have written a sort-of el cheapo replacement. My version is primitive and insecure but it works, a bit. To use it publicly, you'd definitely have to fix the security problems. But in case its useful, here it is: -W. --- the perl script --- #!/users/icd/wmc/bin/perl # This script runs as a server. It listens to port $PORT for IDL # commands encoded in URLs and responds to them, drawing pictures # to the Z-buffer and returning the image as image/gif. # If the plot fails you get an unhelpful error message (but hey, you do at least get one). # Security: # The script runs as me. It will reject commands with "spawn" in. # This should be beefed up a bit # State: # The idl process retains state - you can use variables defined in one call for the next. # But... you may inherit things you don't want (!p.multi, for example) # Interface: # See http://www.nbs.ac.uk/public/icd/wmc/perl/idl-server.html # Bugs: # Needs a reset mechanism for state # Fixes: # 2000/02/02 - prefix commands with "retall" to catch some errors use IO::Socket; use Time::HiRes qw(sleep); $|=1; $server = IO::Socket::INET->new(LocalPort => 1234, Type => SOCK_STREAM, Reuse => 1, Listen => 10) or die "Can't open port"; open IDL, "| idl" or die "Failed to open IDL"; IDL->autoflush; print IDL " set_plot,'Z'\ndevice,set_res=600*[1,1.25]\npolyfill,[0,1,1,0 ,0],[0,0,1,1,0],col=!p.background,/norm\nxyouts,0.5,0.5,/nor m,'sorry your plot failed'\n"; $Nclient=0; while ($client = $server->accept()) { $data=<$client>; ($requested)=($data=~/\?([^ ]*?) /); $requested =~ s/\+/ /g; $requested =~ s/%(\w\w)/sprintf("%c", hex($1))/ge; #print "<req: $requested>\n"; ($cmd)=($requested=~/idl-cmd\=(.*)/ms); $cmd =~ s/\\n/\n/g; #print "<c…
creator: wmc
date: 2000-02-03T08:00:00-00:00