2010-12-02 119 views
0
<?php 
include("XMPP.php"); 

$conn = new XMPPHP_XMPP('server.com', 5222, 'user', 'pass', 'home'); 
$conn->useEncryption(true); 
$conn->connect(); 
$conn->processUntil('session_start'); 
$conn->message('[email protected]', mktime()); 
$payloads = $conn->processUntil('message'); 
$conn->message('[email protected]', mktime()); 
$conn->disconnect(); 
?> 

右...所以它连接 - 它开始会话,并发送我使用的Jabber客户端接收到的第一个时间戳。XMPPHP发送消息,但不会收到

然后它应该“收到处理”消息(afaik),并且如果收到消息发送另一个时间戳。那么,这一点是不起作用的位。

我对XMPP服务器或XMPPHP没有预先的知识,所以所有的帮助,不管基本的,都不会被忽视! :)

谢谢。

+0

尝试传递`new XMPPHP_XMPHP`的最后几个日志记录选项,即`$ xmpphp = new XMPPHP_XMPP($ server_settings [“address”],5222,$ xmpp_settings [“username”],$ xmpp_settings [“password”], $ resource,NULL,TRUE,XMPPHP_Log :: LEVEL_VERBOSE);` – 2010-12-02 18:04:01

回答

1

我与此战斗了一段时间。事实证明,当你连接时你必须宣布你的存在。我这个提取从cli_longrun_example.php并把它放在我的$ conn-后> connect()和$ conn-> processUntil( '在session_start')要求:

$conn->presence($status='Controller available.'); 
0

你可以在你的Jabber客户端recive第一条消息。与

$conn->message('[email protected]', mktime()); 

但你是从服务器recive消息

$payloads = $conn->processUntil('message'); 

,但你不能recive消息说。

和scrpit无法加载haead,所以你不能接收另一条消息。我有同样的问题。你可以使用jaxl。

相关问题