Jump to content

Push


Spook

Recommended Posts

I have made a rather nice livechat application in php/mysql/ajax

I have integrated it onto my website inside members profiles. If they are online the image appears where other members can click to send a livechat request

That dumps a row in a mysql database. Ever 2 minutes, on the other persons homepage, ajax checks the database for requests. If it finds one, it starts the livechat between the two people. Great!

Well, I want to go one better. If its livechat, having a 2 minute delay between requests is a real pain. I know web technology hasn't quite caught up with that yet so are limited, but Im wonderin what the best way to go about it is

I have heard something about 'Server Push' or 'PHP Sockets'

Basically, with msn, when a message is sent it literally is sent straight from them to you. The other persons msn client doesnt query a central server for messages every second. I know its not web language, but is this acheivable using any web languages.

If not, what would you guys suggest

Sure I could make the AJAX refresh every 30 seconds rather than 2 minutes, but sometimes there are 1000 people online. I dont want to blow my server up!

Cheers !

Link to comment
Share on other sites

on the clients, I would consider flash, as it has got socket support from early versions, and for the server you could use php sockets.

if your more comfertable with javascript you could try the flash bridge, and use javascript to make flash create a socket

Socket connections in AS3

livedocs.adobe.com/labs/flex3/html/17_Networking_and_communications_5. html

Socket class for JavaScript using Flash Player >= 6 bridge

www.devpro.it/xmlsocket/

SocketJS

Realtime Sockets in Javascript!

The JS-Bridge to Flash' Socket API

dev.dschini.org/socketjs/

www.aflax.org/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...