Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Comet programming PHP, pushing server

Featured Replies

Hi guys

I would like to implement Comet programming in my website

I mean something like Facebook.com; when some thing happens in server side like inserting new data to database, the web server automatically and with out any request from client send its data to client

I have googled about this and I have found two solutions (called streaming) which are not good at all

1. using hidden iframe

2. using AJAX

they both use an infinite loop and request to the server which is not optimized because it overloads the server.

what Im looking for is called long polling, do u guys know how to implement it?

 

tnx alot

Edited by stallman3738

Hi guys

I would like to implement Comet programming in my website

I mean something like Facebook.com; when some thing happens in server side like inserting new data to database, the web server automatically and with out any request from client send its data to client

I have googled about this and I have found two solutions (called streaming) which are not good at all

1. using hidden iframe

2. using AJAX

they both use an infinite loop and request to the server which is not optimized because it overloads the server.

what Im looking for is called long polling, do u guys know how to implement it?

 

tnx alot

 

I know think its 100% as good as comet programming which i dont know to much about comet programming but why not just simply use ajax through jquery and php. you can refresh divs/content as needed through the use of a javascript function that makes an ajax request to a php file and usinh setInterval which will check for content every set number of seconds which you can set yourself

  • Author

I know think its 100% as good as comet programming which i dont know to much about comet programming but why not just simply use ajax through jquery and php. you can refresh divs/content as needed through the use of a javascript function that makes an ajax request to a php file and usinh setInterval which will check for content every set number of seconds which you can set yourself

 

because in log polling when you open a connection between client and server it will remain open as long as you want that is why this is much more faster than simple ajax and setting interval.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.