tags:

views:

119

answers:

1

I am using XMPP.php (i.e XMPP Class) to create a chat application in GTalk. i have put the correct username and password of Gtalk but it is not working. the code i used (got it from GitHub.com)

<?php

  include 'XMPP.php';

  #Use XMPPHP_Log::LEVEL_VERBOSE to get more logging for error reports
  #If this doesn't work, are you running 64-bit PHP with < 5.2.6?
  $conn = new XMPPHP_XMPP('talk.google.com', 5222, 'username', 'pass', 'xmpphp', 'gmail.com',       $printlog=false, $loglevel=XMPPHP_Log::LEVEL_INFO);

try {
echo "Welcome 2 ";
$conn->connect(100, false, true);
$conn->processUntil('session_start');
$conn->presence();
$conn->message('[email protected]', 'This is a test message!');
$conn->disconnect();
} catch(XMPPHP_Exception $e) {
echo "Fail";
die($e->getMessage());
}

?>

and the error (exception) i am getting is

Welcome 2 Fail Could not connect before timeout.

i am using unix based webserver, is there any software needed to run Chatserver or something like that... please help!

A: 

Generally the problem should disappear after increasing timeout value. Alternately, try out Jaxl library http://github.com/abhinavsingh/JAXL in case you are still facing the same problem ....

Abhinav Singh
yeah! i have seen JAXL, but never tried...i will try that... thank you @Abhinav Singh , i have tried it by increasing the timeout value..but no success...
Harish Kurup