XMPPHP发送消息但收不到

发布于 2024-10-05 06:54:56 字数 827 浏览 4 评论 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 客户端上收到的第一个时间戳。

然后它应该“处理”直到收到消息(据我所知),如果收到消息则发送另一个时间戳。嗯,这一点是不起作用的。

我之前对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏末 2024-10-12 06:54:56

我为此奋斗了一段时间。结果你必须在连接时宣布你的存在。我从 cli_longrun_example.php 中提取了它,并将其放在 $conn->connect() 和 $conn->processUntil('session_start') 调用之后:

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

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:

$conn->presence($status='Controller available.');
素手挽清风 2024-10-12 06:54:56

您可以在 jabber 客户端中收到第一条消息。但

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

随后您会收到来自服务器的消息,

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

但您无法收到该消息。

并且 scrpit 无法加载 haead,因此您无法收到其他消息。我有同样的问题。你可以使用 jaxl 来实现这一点。

you can recive first message in your jabber client. with

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

but then you are recive message from server with

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文