in reply to NTP Error
Why not take it up a notch by using POE:::Component::Client::NTP. The author of Net::NTP joined forces with Chris Williams, so it's built on top of Net::NTP.
I added some error handling, but the way you're doing time just doesn't work for me. I'm tryimg Time::Stamp at the moment, but I haven't got it working right yet. Here's what I have so far:#!/usr/bin/perl -l use strict; use warnings; use Data::Dumper::Concise; use POE qw(Component::Client::NTP); #use Time::Stamp -stamps => {format => 'easy'}; my $host = shift @ARGV; POE::Session->create( package_states => [ main => [qw(_start _stop _response)], ], ); $poe_kernel->run(); exit 0; sub _start { POE::Component::Client::NTP->get_ntp_response( host => $host, event => '_response', ) or die "Couldn't connect to server: $!"; return; } sub _stop { print "Refcount was decremented"; return; } sub _response { my $packet = $_[ARG0]; print Dumper( $packet ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: NTP Error
by BrowserUk (Patriarch) on May 28, 2012 at 09:11 UTC | |
by Khen1950fx (Canon) on May 30, 2012 at 20:42 UTC | |
by BrowserUk (Patriarch) on May 30, 2012 at 21:29 UTC |