Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Problem with script not terminating under Windows XP

by biochris (Beadle)
on Sep 19, 2005 at 20:11 UTC ( [id://493288]=note: print w/replies, xml ) Need Help??


in reply to Re: Problem with script not terminating under Windows XP
in thread Problem with script not terminating under Windows XP

#! /usr/bin/perl -w use strict; use IO::Socket; my ( $local_host, $iaddr, $host, $port, $user, $paddr, $proto, $line, +$sock_handle ); if($ARGV[0]) { $user=$ARGV[0]; } else { $user = getlogin; } ###################end client.head ###################start Make generated $local_host = "host_name"; $iaddr = 192.168.254.33; $host = '192.168.254.33'; $port = 7797; ###################end Make generated ###################start client.tail $|=1; print "PLEASE do NOT close this window, simply minimize it.\n"; print "Thanks,\n\tDan, your friendly system administrator\n"; #this must be set to the ip address of the accounts server. $paddr = sockaddr_in($port, $iaddr); $proto = getprotobyname('tcp'); $sock_handle = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $host, PeerPort => $port) or die "can't connect to port $port on $host: $!"; $sock_handle->autoflush(1); #send computer and username print $sock_handle "$user\n"; print $sock_handle "$local_host\n"; #register signalhandler $SIG{INT} = \&end; #$SIG{TERM} = \ #now update the server once a while while() { #sleep for 10 minutes sleep(10*60); #notify the server that we are alive print $sock_handle "alive\n" } sub end { my $signame = shift; print $sock_handle "quit\n"; close $sock_handle || die "close: $!"; exit(0); }

Can you help?? :)

Edit: g0n - added code tags

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://493288]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found