3 # Written by Curtis L. Olson, started December 2002
4 # Some code portions courtesy of Melchior FRANZ
6 # This file is in the Public Domain and comes with no warranty.
9 # ----------------------------------------------------------------------------
18 my( $handle ) = shift;
20 &send( $handle, "get " . shift );
21 eof $handle and die "\nconnection closed by host";
24 /^-ERR (.*)/ and die "\nfgfs error: $1\n";
31 my( $handle ) = shift;
35 &send( $handle, "set $prop $value");
37 # eof $handle and die "\nconnection closed by host";
42 my( $handle ) = shift;
44 print $handle shift, "\015\012";
51 my( $timeout ) = (shift || 120);
55 if ($socket = IO::Socket::INET->new( Proto => 'tcp',
59 $socket->autoflush(1);
62 print "Attempting to connect ... " . $timeout . "\n";
69 return 1; # make perl happy