in reply to Net::Jabber: Receiving answers without callbacks
the SendAndReceiveWithID function will send the IQ Query and wait for the IQ Response before continuing.while (1) { $count_rooms = 0; %count_users = (); open $html, '>:utf8', 'chatters.html'; print $html qq{<h2>Currently in Chatrooms</h2>\n<ul>\n}; my $Rep; $Rep = $Connection->SendAndReceiveWithID( new_get_iq($ME, $CS, $NS_D_ITEMS), 10); rep_dump( $Rep ); print $html qq{</ul>\n}; close $html; print "Count: $count_rooms rooms, ",scalar(keys %count_users), +" users\n" ; sleep(60); }
|
|---|