XMPPHP发送消息但收不到
<?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 客户端上收到的第一个时间戳。
然后它应该“处理”直到收到消息(据我所知),如果收到消息则发送另一个时间戳。嗯,这一点是不起作用的。
我之前对 XMPP 服务器或 XMPPHP 没有任何了解,因此所有帮助,无论多么基本,都不会被忽视! :)
谢谢。
<?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();
?>
Right... so it connects - it starts the session and sends the first timestamp which is received on the jabber client I'm using.
Then its supposed to "processUntil" a message is received (afaik) and if a message is received send another timestamp. Well, this bit is the bit that doesn't work.
I have no prior knowledge of XMPP servers or XMPPHP, so all help, however basic, wouldn't go unappreciated! :)
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我为此奋斗了一段时间。结果你必须在连接时宣布你的存在。我从 cli_longrun_example.php 中提取了它,并将其放在 $conn->connect() 和 $conn->processUntil('session_start') 调用之后:
I fought with this for a while. Turns out that you have to announce your presence when you connect. I extracted this from the cli_longrun_example.php and put it after my $conn->connect() and $conn->processUntil('session_start') calls:
您可以在 jabber 客户端中收到第一条消息。但
随后您会收到来自服务器的消息,
但您无法收到该消息。
并且 scrpit 无法加载 haead,因此您无法收到其他消息。我有同样的问题。你可以使用 jaxl 来实现这一点。
you can recive first message in your jabber client. with
but then you are recive message from server with
but you cant recive message with that.
and scrpit cant load haead so you cant receive another message. i have a same problem. you can use jaxl for that.