alli123
alli123

Reputation: 33

AJAX Instant messenger

Hi I am trying to make an AJAX instant messenger. I currently have a website (with user logon, admin area etc.) using PHP, MySql, Java Script etc and an AJAX chat prog with 2 chat rooms (and users in room list etc) and it works really good, but dont really know where to go from here (instant messenger wise). I have done some researh which has suggested using an AJAX listener for new messages but I cant find much information on it...or if indeed this is needed or i should use something else. If anyone has any advice where I should go next it would be very, very much appreciated, thanks :)

Upvotes: 0

Views: 4419

Answers (6)

Alfred
Alfred

Reputation: 61771

Node.js

Like a lot of people mentioned I would use node.js/socket.io for this instead of PHP. It has been created to tackle such sort of problems.

Redis

But if you really want to create somethink like this in PHP I would do it using redis(needs to be installed). It has blocking list operations which really help you create something like this. When some user sents a message to another user we push the message to corresponding blocking list of that user. The user listens to an unique blocking list(key) to receive messages.

Can not install Redis

Then you have to use MySQL insert into a table and poll table frequently, but not to much to kill your server/database.

Upvotes: 0

canhnm
canhnm

Reputation: 61

You can try cometd of Dojo Foundation! http://cometd.org/

Upvotes: 0

fifigyuri
fifigyuri

Reputation: 5899

For a chat or chat-like application which needs realtime and immediate responses probably node.js is a way to go. The mentioned socket.io is also built on node.js. It can be used both on server and client side.

There are lot of blogs/tutorials about node.js. Or you may like this, even if it is for a little fee.

Upvotes: 2

benhowdle89
benhowdle89

Reputation: 37454

Use Stream Hub. Reverse AJAX - pretty cool stuff

Upvotes: 0

Trufa
Trufa

Reputation: 40717

Why dont you go with something like AJAX Chat, it's free and open source!

I think it might get you going!

Upvotes: 0

Eamorr
Eamorr

Reputation: 10012

I'd suggest taking a look at www.socket.io for the real-time stuff.

There's even an instant messenger example on the site IIRC.

Upvotes: 0

Related Questions