making the code like so:

    # now wait for packets.. dirty dirty code
    eval {
        print STDERR "waiting for PDU..\n" if ($SMPPDEBUG);

        local $SIG{ALRM} = sub { die "alarm" };
        Time::HiRes::ualarm(100000);            # 100ms alarm
        $pdu = $SMPPCONN->read_pdu()
            or die "$$: PDU not read. Closing connection";
        Time::HiRes::ualarm(0);
    };
   
    # if the cause of "death" was NOT an alarm, that means something
    # serious is going on..
    if ($@ && $@ !~ /alarm/) {
        die $@;
    } else {
        Time::HiRes::ualarm(0);
    }   

_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to