use Net:MPP;
use Data:umper;
$smpp = Net:MPP->new_receiver($host1,

smpp_version => $smpp_version1,
interface_version => $interface_version1,
system_id => $sysid1,
password => $password1,
addr_ton => $addr_ton1,
addr_npi => $addr_npi1,
source_addr_ton => $source_addr_ton1,
source_addr_npi => $source_addr_npi1,
dest_addr_ton => $dest_addr_ton1,
dest_addr_npi => $dest_addr_npi1,
system_type => $system_type1,
facilities_mask => 0x00010003,
port => $port1,
#timeout => 10,
);



while(1){

################ Proses Receiving ################################################## #####
warn "####################################\n";
warn "# SMPP ESME Receive #\n";
warn "####################################\n";
warn "Waiting For message ....\n";


$pdu = $smpp->read_pdu();

print "Received #$pdu->{seq} $pdu->{cmd}:". Net:MPP:du_tab->{$pdu->{cmd}}{cmd} ."\n";
#print "Received #$pdu->{seq} $pdu->{cmd}:". Net:MPP::PDU->{$pdu->{message_id}} ."\n";
warn Dumper($pdu) if $trace;
$smpp->bind_receiver_resp(system_id => $sysid,
seq => $pdu->{seq}
);
$smpp->deliver_sm_resp(message_id => $pdu->{sm_default_msg_id},
seq => $pdu->{seq}
);
$smpp->generic_nack(seq => $pdu->{seq});
################################################## #######################################

################ Respon to Dn ################################################## #########
@mmm = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug',' Sep','Oct','Nov','Dec');
@ddd = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
($x1,$x2,$h,$d,$mm,$yy,$dy) = localtime(time);
$x1 = '0'.$x1 if length($x1) == 1;
$x2 = '0'.$x2 if length($x2) == 1;
$hh = substr(100+$h,-2);
$dd = substr(100+$d,-2);
$mmm = $mmm[$mm];
$mm = substr(101+$mm,-2);
$ddd = $ddd[$dy];
$yyyy = 1900+$yy;
$yy = substr($yyyy,-2);

$seqq = "$pdu->{seq}";
$dn = "$pdu->{source_addr}";
$to = "$pdu->{destination_addr}";
$msg = "$pdu->{short_message}";

#### CAPTURE MSG #####################
open(foo,">>$log1");
print foo"$dd-$mmm-$yyyy $hh:$x2:$x1\t$dn\t$to\t$msg\n";
close(foo);

}



i have script code .. my problem is that code socket timeout 100 second
in line $pdu = $smpp->read_pdu(); with message

premature eof reading from socket at c:/Perl/site/lib/Net/SMPP.pm line 2348.
Not a HASH reference at c:/Perl/site/lib/Net/SMPP.pm line 2349.

so how to make $pdu = $smpp->read_pdu(); timeout//quit before 100 second then i can run script again ( maybe use select(2) and how?? ) .. or anybody can modify code to continue establised

i need this script establised continue to socket(smsc)

thank