在示例中清楚地说明了如何发送消息但是,我不清楚如何接收服务器中其他客户端发起的消息,我们非常感谢任何帮助
这是我发送消息的代码
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();
答案 0 :(得分:0)
要获取消息,您可以使用$data = $conn->processUntil('message');