0

it is clearly stated in the examples how to send message but, i am not clear with how to receive messages initiated by other client in the server any help is highly appreciated

Here is my code for sending the message

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();

1 Answers1

0

To get messages you can use $data = $conn->processUntil('message');

R Singh
  • 765
  • 1
  • 5
  • 10
  • Please take a look at this example: https://github.com/cweiske/xmpphp/blob/master/examples/cli_longrun_example.php . See how `$conn->processUntil` is used in a loop to process 'message' and other events. – R Singh May 01 '16 at 09:57
  • Thank you for the replay, in the command line now it is working but using the webclient_example.php file i am unable to make http bind with my server(Openfire) is there anything you can help... :) – user3642211 May 01 '16 at 20:33