Is it possible to create such a web based Instant Message System?

Reply

Join Date: Nov 2008
Posts: 16
Reputation: kevintse is an unknown quantity at this point 
Solved Threads: 0
kevintse kevintse is offline Offline
Newbie Poster

Is it possible to create such a web based Instant Message System?

 
0
  #1
Jan 12th, 2009
Well, I know there are so many IM services. and that I want to build an IM system is just for practicing my programming skill.
Here there are several questions that come up to my head when starting to design it. As far as I know, we can only receive a response from the server by sending a request to it, but, for an Instant Message System, this is not realistic, by doing that, the Instant Message System is not instant. Let's assume that there is a server and several clients sending messages to it and receiving messages from it, how can I achieve that a client is able to receive a message from the server without sending a request on it's own initiative? this seems not realistic either.
Or I can set a timer using Javascript for a function to be executed from time to time to send asynchronous requests to the server and check if there are any new messages? but this seems not so efficient...

Any ideas?
Last edited by kevintse; Jan 12th, 2009 at 1:51 am.
A little progress a day is what life has to be about.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,600
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 462
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Is it possible to create such a web based Instant Message System?

 
0
  #2
Jan 12th, 2009
Indeed, given that the underlying protocol used in almost all the cases, viz. TCP is connection oriented i.e. following the request/response model, you have to resort to some sort of callbacks or regular polling. Frankly speaking, asynchronous I/O, push pull technology etc. are pretty advanced concepts, not to be messed if you are just starting out. But anyways, to get started read this article which provides a sneak peek into Asynchronous messaging.

For creating standalone IM clients [not web based], look into the different protocols specifically aimed at IM, especially XMPP.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,177
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 481
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Is it possible to create such a web based Instant Message System?

 
0
  #3
Jan 12th, 2009
If you want to see example of working chat system get copy of Java How to Program, 6th edition from Deitel and check out chap 24 at the end
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 137
Reputation: PoovenM is on a distinguished road 
Solved Threads: 11
PoovenM PoovenM is offline Offline
Junior Poster

Re: Is it possible to create such a web based Instant Message System?

 
0
  #4
Jan 13th, 2009
I'm a bit perplexed... since this topic is in the Java forum I'm assuming that some Java programming is involved. As such, I'm imagining a Java Applet since we're speaking about something that's web based. Please correct me if I'm wrong, but if the server knows both users that belong to a conversation, then when one user sends a message (which would be a message to the server), then surely the server could just relay this message across using Sockets in Java. Both the server and the clients need to be listening for communication and everything else is abstracted from us isn't it?

I see that ~s.o.s~ pointed you to an AJAX article... hmmm well I suppose that is Java, but a limited subset. Isn't this more of a web development topic?
Last edited by PoovenM; Jan 13th, 2009 at 5:11 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,600
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 462
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Is it possible to create such a web based Instant Message System?

 
0
  #5
Jan 14th, 2009
> I see that ~s.o.s~ pointed you to an AJAX article.

It was because he mentioned Javascript hence a reference to the Ajax article was in order.
Or I can set a timer using Javascript for a function to be executed from time to time to send asynchronous requests to the server and check if there are any new messages? but this seems not so efficient...
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 137
Reputation: PoovenM is on a distinguished road 
Solved Threads: 11
PoovenM PoovenM is offline Offline
Junior Poster

Re: Is it possible to create such a web based Instant Message System?

 
1
  #6
Jan 14th, 2009
Oh I didn't mean that your post wasn't called for ~s.o.s~, I certainly respect a featured poster such as yourself. I actually skimmed the original post and didn't notice he mentioned JavaScript hehe. It was your reply that made me realize that it was JavaScript related.

I was just confused about why the post was here.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC