【问题标题】:jaxl counld not connect openfire via bosh插孔无法通过 bosh 连接 openfire
【发布时间】:2013-05-24 03:56:02
【问题描述】:

当我运行以下代码时,出现错误(致命错误: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();

【问题讨论】:

    标签: xmpp openfire


    【解决方案1】:

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

    set_time_limit(0);
    

    没有超时。

    【讨论】:

    • 您的意思是set_time_limit(0);?如果需要,请点击edit 更新答案。
    猜你喜欢
    • 1970-01-01
    • 2014-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-09
    • 2011-07-01
    • 1970-01-01
    相关资源
    最近更新 更多