Is there any way to maintain stream from php to the jabber server without javascript to keep the client side live?
Some low end mobile do not support javascript, so to maintain permanent connection to server is key question? any hacks?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PHP is a server-side technology, so there’s no problem there to maintain a connection from the server-side to the XMPP server.
However, if you cannot use Javascript on the client side, your only option is to periodically refresh the web page, where any events queued on the server side will then be given to the client via the newly-generated HTML.
Possibly you could implement a type of Comet- or BOSH-style long-polling by having a meta-refresh of 0, where the web server returns all the current chat info, but doesn’t quite complete the response until a certain time period has passed.
Whether that’s feasible or not probably depends on which clients you wish to support — it’s possible that some mobile browsers don’t do partial rendering as the content comes in, they wait for the entire request to complete.
Also, if the connection was to be interrupted at any point, you’re stuck, as the browser wouldn’t know to do a meta refresh. Possibly there’s some sort of frames-based solution to that where one frame reloads into another?
Have fun! 😉