0

示例中清楚地说明了如何发送消息,但是我不清楚如何接收服务器中其他客户端发起的消息,非常感谢任何帮助

这是我发送消息的代码

include("xmpphp/xmpp.php");

//username = user without domain, "user" and not "user@server" - home is the resource
$conn = new XMPPHP_XMPP('localhost', 5222, 'robel27', 'yoyene122127', 'kiyos');
// Enables TLS - enabled by default, call before connect()!
$conn->useEncryption(false);

$conn->connect();
 // shows the user's status message
$conn->presence();
$conn->processUntil(array('session_start', 'roster_received'));
$conn->processTime(2);
$conn->message('kiyos12@kiyos', $_POST['msg1']);
$conn->disconnect();
4

1 回答 1

0

要获取消息,您可以使用$data = $conn->processUntil('message');

于 2016-04-30T19:40:34.973 回答