fabiang / xmpp

Library for XMPP protocol connections (Jabber) for PHP
Other
179 stars 82 forks source link

Maintain persistent connection - question #49

Open stevanradovanovic opened 7 years ago

stevanradovanovic commented 7 years ago

Hi @fabiang, Is there a possibility to make persistent connection? Currently, when I send message and receive response, it's automatically disconnected. Can I prevent it and keep connection alive? Thanks!

bpetar commented 7 years ago

Looking for the same answer. My PHP api script ends after each call, each new call is separate process, so this is really a PHP question how to maintain a thread which does the XMPP communication while other PHP scripts are 'giving' it what to do.

bradleybensmith commented 7 years ago

That's exactly what I was just looking to do. In my case, I'm using Laravel, so can spin up a queue worker that should be able to maintain a connection and send messages as needed.

You'll definitely need some kind of CLI script to maintain a persistent connection like that.

n0n0n0n0 commented 7 years ago

@bram1028 can u please explain how to make persistent connection with laravel?