Saturday, 15 May 2010

PHP: Maintain a persistent connection to an XMPP chat client -



PHP: Maintain a persistent connection to an XMPP chat client -

i'm creating basic chat client using xmpphp. other chat client spark (only test purposes). don't understand why connect() functioon in xmlstream.php have timeout of 30 secs.

1) customizable ?

2) if wish maintain persistent connection without timing out i.e. without getting idle or disconnected ?

the timeout of 30 seconds happen if invoke php script via browser. that's max time browser waits page load.

in order bypass it, need tell server wait more time page load. utilize set_time_limit(x); @ origin of php script , x amount of time want script maintain running.

x=0 means infinity ( not recommended).

you can run php script via command line time limit not apply.

php xmpp chat xmpphp

No comments:

Post a Comment