P. 1
Chat Application

Chat Application

|Views: 549|Likes:
Published by Roshen Po

More info:

Published by: Roshen Po on Apr 21, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

12/19/2012

pdf

text

original

CHAT APPLICATION

INTRODUCTION We want to develop a simple, multi client chat program. We want the clients to be able to connect to a server, sending messages and recieving messages from it. DIFFERENT METHODS

1) Polling Vs Comet In Polling client must regularly hit the server to check for updates . While Comet pushes data from the server to the browser without the browser requesting it. Polling Disadvantages The main drawback of the polling approach is the amount of traffic generated as it scales to many .Each lients. Eac client must regularly hit the server to check for updates, which places a burden on the server's resources. Comet Advantages Comet technique is a variant of polling called long polling. The main difference between polling and long polling is how long it takes the server to respond. The advantage of a long poll over normal polling is that data goes from the server to the client as soon as it is available. The request may wait a long time with nothing to send back, but once there is something new, it is immediately sent to the client. There is no latency. Web-based chat program, or anything that claims to be "real-time", it probably used this technique.

2) Build a SOAP-based Chat Application with Java Web Services http://www.devx.com/webdev/Article/16853/1954 3) Build chat applications using just the streams available in the standard API. The chat uses TCP/IP sockets to communicate, and can be embedded easily in a Web page. http://www.javaworld.com/javaworld/jw-01-1997/jw-01-chat.html

In this model.a. The Framework contains its own web serve own server called ³Atmosphere Spade Server´. . If you are using Atmosphere framework please be aware that only aware that only Jetty. GlashFish. XMPP ± XMPP server integration for chat applications server . AJAX push is an exciting feature of ICEfaces which enable us to develop Comet web application wit application with simple Java API without worrying about the low-level details of the push-mechanism mechanisms. buddy lists). In reality. you can code I you can code in JavaScript . A single topic .MINA (Multipurpose Infrastructure for Network Applications) is a network application framework which helps users develop high performance and high scalability network applications easily. a producer can send a message to many consumers by delivering the message to a single topic. XML-inspired protocol for near-real-time. Apache MINA . because DWR is a Java to JavaScript interface.Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients.It is an open source AJAX based framework for developing Rich Internet Applications using java.html) .Atmosphere is a Comet framework which can work on any JEE web server. and communicate with a Java back-end with back-end without the magic of translating/rewriting Java into JavaScript. Java . ³Extensible Messaging and Presence Protocol (XMPP) is an open. the native language of the browser.API's 1) Comet and Server-Side JavaScript tool. and Grizzly servers can make use of asynchronous native API (comet usessssssssssss using non-blocking IO technique for building highly scalable communications )ICEfaces AJAX push with ICEfaces. Grizzly Comet API . since chat systems don't require e don't require enterprise quality service.k. It greatly simplifies and streamlines network programming such as TCP/IP socket server 2) JMS pub/sub API to build a simple chat application (http://oreilly. using JMS for a chat application would be overkill. ATMOSPHERE . The requirements of Internet chat map neatly onto the publish-and-subscribe messaging model.com/catalog/javmesser/chapter/ch02. Netty .Grizzly ensures greater performance by Asynchronous request processing which makes use of the thread pool system pool system. DWR(Direct Web Remoting) ± DWR helps Java developers ease the transition to using JavaScript. extensible instant messaging (IM) and presence information (a. In comparison to GWT. In this model. in addition to providing real-time capa real-time capabilities.

net/ Description:FreeCS is a free chatserver (WebChat) written in Java.net/ Description:Chat Everywhere gives you the possibility to easily put a real-time discussion forum on your website.ContinuationSupport class to create an instance of org.Continuation for any HttpServletRequest. By:A. It allows extended (Irc-like) . While the request is suspended.sourceforge. The resumption could happen either because of a timeout or some other. The idea is simple enough.util. Two of the most popular open source servers.util. have both leveraged NIO to add non-blocking IO and thus enable Comet. It is especially suited to applications to applications that require realtime interaction among multiple clients. 2.mortbay.mortbay. Jetty supports the programming construct known as continuations. Apache Tomcat and Jetty.Tomcat And Jetty To handle Comet efficiently. But even better: It is OpenSource. its thread is freed up. The Jetty server uses a slightly different technique to enable a scalable implementation of Comet.Elko is a Java-based server framework for building stateful. This means.ajax. (No java-applets are needed.3) Elko . sessionful applications in the web. 3. which is able to to show HTML-Files) 4.com/software/elko 4) Smack API . Chat Everywhere. You can use Jetty's org. that everybody may contribute her/his own codesnippets and improvements or just implement special things for their own benefits. and Java has this via its NIO library.http://www.we can build a Java application which works in the same way as these popular (jabber & pidgin) XMPP clients CHAT SERVERS 1. FreeCS By:License:GNU General Public License URL:http://freecs.sourceforge. you need non-blocking IO.fudco. A request is suspended and continued at some point in the future. meaningful event. making it compatible with every client. de BernisLicense:GNU General Public License URL:http://chateverywhere.ajax.

net/projects/llamachat/ Description:LlamaChat is designed to provide an open source. but very configurable. and more. LlamaChat By: countjoeLicense:GNU General Public License URL:http://sourceforge. And if web browser support applet and css2. An XMPP server. It is written in java and supports many advanced chat functionality including secure connections. portable C). . It does not require admin (root) rights.net/ Description:Chipchat is a web chat program written in java language. administrative class users. several levels of hierarchy and an easy to modify configuration file.LeeLicense:GNU General Public License URL:http://chipchat. Chipchat By: Mr. Java XMPP/Jabber Server OpenIM Java XMPP/Jabber ® Server is an open-source Java implementation (BSD License) of XMPP/Jabber Instant Messager. 6. There is no need to install program in client. chat zone on their site. It is a web application and needs a web server such as Tomcat.1 well. but it use appet for communication with server and javascript for updating screen. The requirements on the client side are as low as a java enabled browser (most of them are).sourceforge. chat server/client pair for use on the web. The server is very light (coded in standard. and can run on very small servers. 5. It work well in any OS and Web browser. The goal of this project is to provide webmasters with a simple to use. This does not use http refresh feature. So screen is updated smooth.commands. 7. emoticons.

com/java-code-snippets-tutorials/551-how-write-simplexmpp-jabber-client-using-smack-api.REFERENCES http://www.com/developerworks/web/library/wa-cometjava/ http://www.com/blog/2011/01/03/many-comet-solutions-for-your-real-time-apps/ http://www.net/articles/218-introduction-to-comet-and-reverse-ajax-1.javabeat.sitepen.html http://www.javaprogrammingforums.html .ibm.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->