X hits on this document

PDF document

February 10, 2006 - page 173 / 238

948 views

0 shares

0 downloads

0 comments

173 / 238

$mcid->to_mc($name); $ d a t a r e f = $ e v e n t - > g e t _ d a t a ( ) @data = @$dataref; ;

print ("Got event: $$name "

, $ e v e n t - > g e t _ r e c o r d _ i d ( ) ,

print "

" ", $event->get_type(), Data: ";

""

, $ e v e n t - > g e t _ t i m e s t a m p ( ) ,

while (defined ($val = shift @data)) {

printf " %2.2x", $val; } print "\n";

}

package Conh; sub new { my $obj = { }; $obj->{first_time} = 1; return bless \$obj;

}

sub conn_change_cb { my $self = shift; my $domain = shift; my $err = shift; my $conn_num = shift; my $port_num = shift; my $still_connected = shift;

if ($err && !$still_connected) { print "Error starting up connection: $err\n"; exit 1; } e l s i f ( $ $ s e l f - > { f i r s t _ t i m e } ) my $event_handler = Eventh::new(); {

  • #

    Register an event handler on the first time.

$$self->{first_time} = 0; $rv = $domain->add_event_handler($event_handler); if ($rv) {

print "Error adding event handler, closing\n"; $domain->close(); exit(1);

}

}

}

package Uph;

"\n");

161

Document info
Document views948
Page views948
Page last viewedSun Dec 11 10:48:11 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments