0
SMSC에 영구 연결이 설정되면 다음 코드를 계속 실행하는 방법. 여기서 setRecvTimeout (60000)의 명확한 의미는 무엇입니까?Smpp는 PHP에서 SMS를 수신합니다.
<?php //Receive sms
require_once 'smppclient.class.php';
require_once 'sockettransport.class.php';
// Construct transport and client
$transport = new SocketTransport(array('smpp.provider.com'),3600);
$transport->setRecvTimeout(60000); // for this example wait up to 60 seconds for data
for(;;){
$smpp = new SmppClient($transport);
// Activate binary hex-output of server interaction
$smpp->debug = true;
$transport->debug = true;
// Open the connection
$transport->open();
$smpp->bindReceiver("USERNAME","PASSWORD");
// Read SMS and output
$sms = $smpp->readSMS();
$read = $sms -> message;// reads the message
echo $read."\n";
$phone = $sms -> source-> value; //gets the phone number
echo $phone."\n";
echo "SMS:\n";
//var_dump($sms);
// Close connection
$smpp->close();
}
?>
누군가이 코드를 계속 실행하는 방법을 알려주십시오. –
이미 무한 루프 ('for')에 있지 않습니까? –
이 코드를 계속 실행하려면 시간 제한을 설정해야합니까? –