| | |
Is it possible to create such a web based Instant Message System?
![]() |
•
•
Join Date: Nov 2008
Posts: 16
Reputation:
Solved Threads: 0
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?
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.
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.
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.
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
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
Join Date: Aug 2006
Posts: 137
Reputation:
Solved Threads: 11
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?
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.
> 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.
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.
•
•
Join Date: Aug 2006
Posts: 137
Reputation:
Solved Threads: 11
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.
I was just confused about why the post was here.
![]() |
Similar Threads
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
Other Threads in the Java Forum
- Previous Thread: James Bond Search Program
- Next Thread: Sending Images from server to client
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program project property recursion ria scanner search server set sharepoint smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree unlimited webservices windows






