jaxb无法通过波什连接openfire

时间:2013-05-24 03:56:02

标签: xmpp openfire bosh

当我运行以下代码时,出现错误(致命错误:E:\ wamp \ www \ chat \ vendor \ abhinavsingh \ jaxl \ xep \ xep_0206.php上线超出最多执行时间30秒) 123)。但是当我注释掉这一行('bosh_url'=>'http://test.com:7070/http-bind')时,它似乎很好。谁能告诉我什么是错的?

 <?php

require_once __DIR__ . '/vendor/autoload.php';

$client = new JAXL(array(
    'jid' => 'devin@localhost',
    'pass' => 'like',
    'bosh_url' => 'http://test.com:7070/http-bind',
    'log_path' => __DIR__ . '/logs',
    'log_level' => JAXL_INFO,
    'strict' => false,
));

$client->add_cb('on_auth_success', function() {
    global $client;
    echo 'on_auth_success', '<br/>';
    $client->set_status("available!");  // set your status
    //$client->get_vcard();               // fetch your vcard
    //$client->get_roster();              // fetch your roster list
});


/*$client->add_cb('on_chat_message', function($msg) {
    global $client;
     echo 'on_chat_message', '<br/>';
    // echo back
    $msg->to = $msg->from;
    $msg->from = $client->full_jid->to_string();
    $client->send($msg);
});

$client->add_cb('on_disconnect', function() {
    _debug("got on_disconnect cb");
});
*/

$client->start();

1 个答案:

答案 0 :(得分:0)

因为PHP正在等待这个过程。您可以在终端中运行它:php XXX.php。添加以下行:

set_time_limit(0);

没有超时。