StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Internet Chat System - Essay Example

Cite this document
Summary
This paper 'Internet Chat System' tells that This dissertation presents the designing of Internet Chat System using the Java object-oriented programming language. With the utilization of Java Network Programming and Java Applet Programming, the multi-user chat system is embedded over a web page using HTML coding…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER93.6% of users find it useful
Internet Chat System
Read Text Preview

Extract of sample "Internet Chat System"

Designing and Implementing of a Multi-user Internet Chat System in JavaTM Jeetender Singh Panwar January 2007 Dissertation submitted in partial fulfilment for the degree of Master of Science in Information Technology Department of Computing Science London South Bank University Abstract This dissertation presents the designing and development of Internet Chat System using the Java object-oriented programming language. With the utilisation Java Network Programming and Java Applet Programming, the multi-user chat system is embedded over a web page using HTML coding. The system comprises two-tier application, the server and client applications. The client side of the system using TCP/IP application relies on the java.net.Socket class. The socket class is used for normal two-way socket communications and much of the work involved in establishing connection has already been packaged in this class. It has methods that allow read and write byte streams through the socket. TCP/IP server applications rely on a networking class provided by Java, java.net.ServerSocket. This class takes most of the work out of establishing a server. ServerSocket allows you to bind a port and wait for clients to connect, setting up a complete Socket object at that time. After communications are complete with the client, the server must close the streams and then close the Socket instance. Since the application requires multi-user, with Java's multithreading available, the creation of multithreaded server application is used which allows simultaneous connections with many clients. This multithreaded-server structural design is specifically network servers utilise. In this dissertation, the use of Java Networking Sockets to create multi-user online chat system is presented. In order to provide real-time instant access to clients, the client application is installed or embedded on a web page for easy access as java applet. Attestation I attest with the aim of this dissertation reports original work by me throughout my University project except for the following: The conversion instruction of Java application to Applet is taken from 5.3. Figure 2 is taken from 5.3. Other references mentioned are specified in the References section of this paper. Acknowledgements This dissertation has not made possible without the help of some key persons who in one way or the other help succeed in the completion of this paper. To Mr./Ms. (insert name of adviser or instructor), who served as my adviser and instructor with this paper. He had not just thought me to do the technical part but also encouraged and gave me challenge in the field of study I practised. Thank you for being a mentor all the way. With this, I would like to take the opportunity to thank as well to my parents and friends who are always there to lend a helping hand. And, to my classmates who shared time and experiences along the duration of school years, thank you all. January 31, 2007 Table of Contents Designing and Implementing of a Multi-user Internet Chat System in JavaTM 1 Jeetender Singh Panwar 1 Abstract 1 Abstract 1 Attestation 2 Attestation 2 Acknowledgements 3 Acknowledgements 3 Table of Contents 4 Table of Contents 4 List of Figures 5 List of Figures 5 1 Introduction 6 2 State-of-The-Art 9 3 Developing the Server-Client Application 11 4 Implementation 15 5 Conclusion 17 References 18 References 18 Appendix 1 - Server Class 19 Appendix 1 - Server Class 19 Appendix 2 - Client Class 20 Appendix 2 - Client Class 20 List of Figures Figure 1: Server-Client Communication Diagram 10 Figure 2: The Multi-user Chat System Framework 12 Figure 3: A Client/Server Connection 12 Figure 4: Screenshot of the Client Application in an Applet 16 Figure 5: Screenshot of the Server Application 16 1 Introduction The popularity of Internet Chat Systems has grown interminably and security is always a threat for users. Hacking and online identify theft is common via chat rooms. Since Java is a robust and secured language, developing a multi-user chat system in Java architecture would contribute solution to this effort. Currently, there are many Internet Chat Systems available in different platforms and even using Java. This dissertation is purposed to design and implement a prototype system, which will simulate a client/server Java application using Java Network Programming components. Commonly, online chat systems are used for communication medium from even corporate or personal use. There are various chat systems in use over the web arena. Web-based chat system for customer support online, community chat boards and of any varied purposes. Internet Relay Chat or IRC is one of the premier chat system available and still in use for most online community and organisations. Garrett's (1996) study found that: Chat has been presented as a feature primarily for enhancing consumer entertainment on the Internet. Few businesses actually depend on a chat system in the intranet environment. Nevertheless, Web Chat does lend itself to a variety of business communication applications. The first example of a business application for Web Chat serves as a bridge between the consumer environment and the internal business environment 5.3. 1.1 Background and Context The popularity of web-based chat systems is made popular with the aid of the popular web browser. Users find it easy for web-based chat system since they are familiar with it for browsing websites. Java Network Programming components provide secure and multi-platform chat server/client, and the client tier is embedded in on web page using applets components. The use of Sockets will handle the communication link over the network, client/server application. The Sockets provides and handle various remote requests over the network stream. 1.2 Scope and Objectives The objective of this project is to create a multi-user Internet chat system using Java as its development language. The application must comprise the server and client application wherein the server application controls a multithreaded chat sessions while the client application is embedded in a web page. It is anticipated that the simulation of the server/client application using Java Sockets for network programming will provide beginner programmers the avenue to evaluate and develop future server-client application using Java, whilst this development will provide general overview as well of the Java Networking components. 1.3 Achievements Successful implementation of a multi-user chat application, with server/client tiers, using various components of Java was accomplished. The integration of the client application using Java applets over HTML page creates an opportunity to reach many users. Through the use of Java, a secured server application is attained to insure the data request is handled appropriately. 1.4 Overview of Dissertation In the stat-of-the-art section, the introduction about leading web-based multi-user chat system will be discussed. This will explain the significance of the use of Java programming language in developing the application. Related technologies will also be examined to how it will contribute to the implementation of the multi-user application over secure socket components. "Java applications can listen for network connections and respond to them 5.3." 2 State-of-The-Art Java Networking Programming is known for its cross-platform and robustness among programming languages. With its networking components, Java is capable of developing an object-oriented programming by means of multithreaded application development. Java Applications can be integrated to any platforms. For this project, the client application is embedded in a HTML page using Java Applets. Applets are Java programs designed to run in Java enabled browsers. They are generally stored in web server together with the HTMLs, GIFs, and other resources needed for the web application. The applet is downloaded when a browser loads the web page and after loading, it executes the web application. Java Networking Components, the stream sockets, are used to demonstrate a client/server capable application. In order for clients to know how to communicate with the server, standard application protocols are assigned well-known ports. In Java, creating TCP/IP socket connection is made available straightforward with the java.net package. Below is a diagram of what occurs during the server and client side communication: Figure 1: Server-Client Communication Diagram An important aspect of multithreaded application is that threads can communicate with each other. Several threads can manipulate a single object independently. The concept of communication on a multithreaded applications (and applets) uses several execution contexts to accomplish their tasks. Multithreaded application makes use of the fact that many tasks contain separate and distinct sub-tasks. Java makes it possible to explicitly create and control a define thread. Multithreading is important to understand because one of the great advances Java makes over other programming languages is that at the very heart of the language support the threading. By using threading, you can avoid long pauses between what the users do and when they see things happen when they interact with the application. "The most common types of programs written in Java programming language are applets and applications 5.3." There are numerous of Online Chat Systems that provides instant communication at a corporate and personal level of use. Stand-alone applications like Yahoo! Messenger, AOL, Jabber, etc. now provide API to developers to create a modified chat application under their protocol. But, custom build multi-user chat systems re still opted by most. 3 Developing the Server-Client Application "Most modern network programming is based on a client/server model 5.3." With the technology provided by Java, developing a multi-user application is straightforward with the GUI and sockets, which allows access to different communication ports. No explicit standards are present with Java Networking API but the implementation of peer-to-peer and even multithreaded communication is possible. The Internet Chat System will be a multi-user application handling multithreaded instances from clients. "The ChatServer class is responsible for accepting connections from clients and providing each client with a dedicated thread for messaging. The ChatHandler is an extension of class Thread. This class is responsible for receiving client messages and broadcasting those messages to other clients. 5.3". ChatServer class is defined as the server application while ChatHandler will be the client or user class. Figure 2 describes the general overview of the system in a diagram framework. Figure 3 illustrates a sample chat system with client-server tiers communicating over the Java Network Protocols. TCP socket is used in this application. Java Enterprise Edition (J2EE) or Java Standard Edition (J2SE) is utilised. Figure 2: The Multi-user Chat System Framework Figure 3: A Client/Server Connection 3.1 Server Application TCP/IP server applications rely on a networking class provided by Java: java.net.ServerSocket. This class takes most of the work out of establishing a server. ServerSocket allows you to bind a port and wait for clients to connect, setting up a complete Socket object at that time. Refer to Appendix 1 for the Server Class code in this section. After creating a ServerSocket, the accept() method can be used to wait for a client to connect. The accept() method blocks until a client connects, and then returns a Socket instance for communicating to the client. The program's thread of execution does not proceed past the blocking routine until it returns, that is, when the specific condition happens. Look at the code sample below that will create a ServerSocket at a port, which accepts a connections, and then opens streams through which communication can take place once a client connects: (NOTE: please replace the code you have here with your code where it has similar functions under SERVER class) try { serverSocket = new ServerSocket(port); while(true) { socket = serverSocket.accept(); ChatHandler handler = new ChatHandler(socket); handler.start(); } } catch(IOException ioe) { ioe.printStackTrace(); } finally { try { serverSocket.close(); } catch(IOException ioe) { ioe.printStackTrace(); } } After communications are complete with the client, the server must close the streams and then close the Socket instance, the server must close the streams and then close the Socket instance, as previously described. 3.2 Client Application The client side of the TCP/IP application relies on the java.net.Socket class. The Socket class is used for normal two-way socket communication and much of the work involved in establishing connections had already been packaged in this class. It has methods which allows to read and write byte streams through the socket, there are: getInputStream() and getOutputStream(). To make the application simpler to design, the streams these methods return are usually decorated by another object, such as DataInputStream and PrintStream respectively. Refer to Appendix 2 for the Client Class code in this section. Both getInputStream() and getOutputStream() throw an IOException, which should be caught. See the following codes below: (NOTE: please replace the code you have here with your code where it has similar functions under CLIENT class) public ChatHandler(Socket socket) throws IOException { this.socket = socket; in = new BufferedReader( new InputStreamReader(socket.getInputStream())); out = new PrintWriter( new OutputStreamWriter(socket.getOutputStream())); } Once it has completed communicating through the socket, you must first close the InputStream and OutputStream instances, and then close the socket. output.close(); input.close(); sock.close(); 4 Implementation To implement the server-client application, the host and client machine must have Java plug-ins for your system. Install the Java(TM) SE JRE or JDK. The server application can run independently on the server or localhost. While, as required by the scope of this project, the client application must be embedded on HTML page using applet. Below are steps on how to convert Java Applications to Applets to suit the requirement of this project. The conversion instruction below is derived from 5.3: Basic steps to follow to convert an application program into an applet program: create a subclass of java.applet.Applet in which you override the init method to initialize your applet's resources the same way the main method initializes the application's resources. init might be called more than once and should be designed accordingly. Moreover, the top-level Panel needs to be added to the applet in init; usually it was added to a Frame in main. That's it! After converting the client application to applet form, using the following code below will help embed the client chat to the HTML webpage. (NOTE: change the applet code below with what you have on you HTML page code for applet embedding) Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Internet Chat System Essay Example | Topics and Well Written Essays - 4500 words”, n.d.)
Internet Chat System Essay Example | Topics and Well Written Essays - 4500 words. Retrieved from https://studentshare.org/technology/1528507-internet-chat-system
(Internet Chat System Essay Example | Topics and Well Written Essays - 4500 Words)
Internet Chat System Essay Example | Topics and Well Written Essays - 4500 Words. https://studentshare.org/technology/1528507-internet-chat-system.
“Internet Chat System Essay Example | Topics and Well Written Essays - 4500 Words”, n.d. https://studentshare.org/technology/1528507-internet-chat-system.
  • Cited: 0 times

CHECK THESE SAMPLES OF Internet Chat System

Business Information and Demographical Data at Club IT

Moreover, if strategically aligned with the business strategy, the system can also address the future expansion and workload management of day to day operations of the Club.... Likewise, one of the prime features of these services will be a Wireless hotspot, as it will provide internet access within the premises.... Moreover, with the help of wireless internet, customers will use online club IT portals to order food and drinks....
7 Pages (1750 words) Assignment

The Internet and the E-Business

… The internet is the key platform of e-Business which works through electronic to distribute goods and services between business partners all over the world (Canzer 5).... The internet and e-business will be used in the institution for four main purposes; to give strategy and direction with regard to e-business, to maintain cordial relationship between the stakeholders, and the institution's community as a whole, to improve communication and information in learning, and other interactions, and to maintain process and culture of e-business for a good gain (Canzer 7)....
6 Pages (1500 words) Assignment

ITM501 MOD 4 SLP Assign Mangement Information System

The use of cloud computing can create the availability of the computer system through the internet very easily and can also find out if an unauthorized person is trying to create or remove information files.... Different purposes are involved such as audio and video conferencing, chat systems, project management etc.... In the modern business world, people do their work together online by using various tools in internet through online collaboration....
3 Pages (750 words) Essay

The Internet Revolution: Before and After

Even when people are in the same household, individual family members are increasingly locked away on personal computers, engrossed in communicating with a stranger 5000 miles away in an internet chat room or via instant messenger.... Through a publicly accessible system of interconnected computer networks that transmit data in previously unheard-of ways, individuals and organizations have access to electronic mail, online chats and the world wide web of interlinked pages (Wikipedia)....
2 Pages (500 words) Essay

Course Management Systems

This technology is called a CMS, or Course Management system.... Synchronous tools include the chat feature, which some instructors like to use to setup office hours with their students, or question and answer sessions via an appointment (Cole and Foster, 2007).... Currently there is a new technology-driven concept that can assist one with online or traditional learning via the internet.... First, both teachers and students can obtain information from the CMS wherever they go, as long as they have a computer and an internet connection....
4 Pages (1000 words) Essay

The Customer Services

A new trend of adopting Live chat to customer services best practice.... hellip; With a significant change in behavior from retailers and consumers have created a perfect scenario for live chat to make a significant impact on delivering a great customer experience that drives profits and keeps customers loyal.... Live chat In the modern online business environment the services are more important than it was in earlier days.... A new trend of adopting Live chat to customer services best practice....
2 Pages (500 words) Essay

Analysis of Ethics in Google Company

Among the technical issues that arise is the possibility that companies may be gathering data from children through chat rooms.... Among the technical issues that arise is the possibility that companies may be gathering data from children through chat rooms.... With such disregard for the privacy of internet users, some people may develop a fear that they are Ethics in Google There are several ethical issues related with sharing data on Google....
1 Pages (250 words) Essay

Effect of Internet Regulation on Chinese and Industry

However, the two nations' differences over internet freedom have increasingly attracted global attention.... However, the two nations' differences over internet freedom have increasingly attracted global attention.... Secretary of State Hillary Clinton strongly admonished the Chinese government over internet censorship.... The debate on internet regulation in China has been a major issue among global policy makers and scholars alike since China adopted internet connectivity in 1994....
8 Pages (2000 words) Assignment
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us