Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Web Chat Application: A Client-Server Architecture, Lecture notes of Law

The design and implementation of a web chat application that utilizes a client-server architecture. The application allows multiple clients to connect to a central server and engage in real-time communication. The functional and non-functional requirements, design diagrams, source code for both the server and client programs, and implementation details. It also includes a performance analysis section that examines the application's methodology, analytics, and outputs. The conclusion discusses the project's achievements and future scope. This comprehensive guide provides valuable insights into the development of a web-based chat application, covering topics such as socket programming, server-client interactions, and the java swing gui framework. The document could be useful for students, developers, or researchers interested in understanding the principles and implementation of a client-server-based chat application.

Typology: Lecture notes

2022/2023

Uploaded on 02/21/2024

bhavan-parmar
bhavan-parmar 🇮🇳

1 document

1 / 54

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
WEBCHAT APP
Project report submitted in partial fulfilment of the requirement
for the degree of Bachelor of Technology
in
Computer Science and Engineering/Information Technology
By
ARYAN PAL SINGH (161236)
Under the supervision of
Dr. Hari Singh Rawat
to
Department of Computer Science & Engineering and
Information Technology
Jaypee University of Information Technology Waknaghat,
Solan-173234, Himachal Pradesh
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36

Partial preview of the text

Download Web Chat Application: A Client-Server Architecture and more Lecture notes Law in PDF only on Docsity!

WEBCHAT APP

Project report submitted in partial fulfilment of the requirement

for the degree of Bachelor of Technology

in

Computer Science and Engineering/Information Technology

By

ARYAN PAL SINGH (161236)

Under the supervision of

Dr. Hari Singh Rawat

to

Department of Computer Science & Engineering and

Information Technology

Jaypee University of Information Technology Waknaghat,

Solan-173234, Himachal Pradesh

CERTIFICATE

Candidate’s Declaration

I hereby declare that the work presented in this report entitled “WebChat App” in partial fulfilment of the requirements for the award of the degree of Bachelor of Technology in Computer Science and Engineering/Information Technology submitted in the department of Computer Science & Engineering and Information

Technology , Jaypee University of Information Technology Waknaghat is an authentic

record of my own work carried out over a period from May 2020 to June 2020 under the supervision of Dr. Hari Singh , Assistant Professor (SG) , Department of Computer Science & Engineering and Information Technology. The matter embodied in the report has not been submitted for the award of any other degree or diploma. Aryan Pal Singh Roll No - 161236 This is to certify that the above statement made by the candidate is true to the best of my knowledge. Dr. Hari Singh Assistant Professor (SG) Department of Computer Science & Engineering and IT Dated:

TABLE OF CONTENTS

  • LIST OF FIGURES SERIAL NUMBER PAGE NUMBER
  • ABSTRACT
    1. INTRODUCTION
  • 1.1 Introduction
  • 1.2 Problem Statement
  • 1.3 Objective
  • 1.4 Methodology
  • 1.5 Organisation of Report
    1. LITERATURE SURVEY
  • 2.1 Chatting App
  • 2.2 Socket and RMI using Stimulating Environment
  • 2.3 Java Socket Programming
  • 2.4 Enhanced Education Chat System
  • 2.5 Socket programming in Distributed Environment
    1. SYSTEM DEVELOPMENT
  • 3.1 Description of web chat application
  • 3.2 Design Diagram
  • 3.3 Functional and Non-Functional Requirement
  • 3.3.1 Functional Requirement
  • 3.3.2 Non-Functional Requirement
  • 3.4 Implementation Detail
  • 3.4.1 Source code of server program
  • 3.4.2 Source code of client program
  • 3.4.3 Method Implementation
  • 3.4.4 Swing
  • 3.4.5 Other data structure and methods
  • 3.5 Implementation Issue
  • 4 PERFORMANCE ANALYSIS
  • 4.1 Methodology
  • 4.2 Analytics
  • 4.3 OUTPUTS
  • 5 CONCLUSION
  • 5.1 Conclusion
  • 5.2 Future Scope
  • REFERENCES

ABSTRACT

In this project, one can do live chat with others. For this we use server-client architecture. In this, we used to have a server and with this server different clients can connect. Now, in order to establish connection with server with clients we use the concept of socket programming. Now let me throw some light on socket programming. Since for a machine to connect with other machine there is need of socket. So with the help of sockets server, can also connect to different clients and thus data transfer can take place in very efficient way. In this server program will run on server and during the time server program is running, client will also run its program from respective computer and matching the IP address and port number of server connection will take place and data transmission can occur. Similarly, various clients can connect to server through server’s port number. Thus, client will send request to server for connection and server will respond to request and thus live chat will take place on server between various clients connected to server.

CHAPTER - 1

INTRODUCTION

1.1 Introduction

This project is about how different users can communicate in real time with each. With real time it can said to communicate live with each other on a single platform. So to make this thing possible we have a communication platform for chatting which is client server architecture.In this application, we will have various clients who can join a private or public server and can communicate with other clients using that server. In this world we have different platforms which uses this concept like youtube. In youtube, when someone do live streaming you will see various people are chatting side by side of video in real time. So here there is a server of youtube and we have various users as clients who are connected to that server and it is server-client architecture through which it was possible that all users were able to have a communication with other clients in present time on a single platform. Now in this chat app to communicate through machines of individuals and server we have a thing in each machine known as sockets. These are only sockets through which it was possible for different machines to establish connection with each other. This establishment of different machines is possible only due to socket programming. Due to socket programming it is possible for machines to have end to end communication and send data from one device to other. Now we will see about sockets in detail in system development section. There is one more application where this web chat is brought in great use.

1.2 Problem Statement In todays world everyone in there life is busy in race of achieving goals and for that they need to run a lot from here to there. Also these days, if any big meeting is to be done or any big gatherings are needed to be held then a person will think many times for attending it considering the factors of traffic jam on his way, facilities for having night stays there. Recently whole world is suffering from viruses like corona where it is impossible to have social gatherings. So to overcome these problem we need a platform where people can virtually attended meetings and do talking to each other in live. So web chat app can be a very good and efficient solution to this problem. Using socket programming and client-server architecture it is very easy to do remote chatting for users from there homes. But practically it is not possible that everyone has a computer and he can do web chatting. So it is also platform independent. As these days a cheaper smartphone is available with sockets as is capable of doing virtual live chats. So no matter how far you are the only thing required is any type of connection with server and one can use the benefits of web chat. Now major question is how to achieve this communication. For this we will use client-server architecture approach. In this different clients located at different locations can connect to a common server by knowing the address of server and server will distribute the data of one server with other users. Now working of this chat app will be seen in implementation section.

1.3 Objective The main objective or we can say that fundamental objective of Web Chat application is to provide chatting service to all users connected to a particular server. So that they can have easy, fast and real time communication with each other. Whenever a new user want to join the server, his/her request is accepted and then server respond with it and thus user gets connected and become a part of this live chat. Whatever data is transferred by a user to server is distributed to all users connected to that particular server. 1.4 Methodology Main aim of Web Chat Application is to connect various users to a common server. The main method used in this is server-client architecture. In this we will have a server program which will be executed initially and then client program will be executed. Then client will send request to the server by knowing the address of server and on reflection server will give response to that specific client and connection will be established between them. This is done due to the presence of sockets in each machine. Then after setting up connection data will be sent out by a machine using output stream buffer to the server. Server will accept data using input stream buffer and to distribute this data to other clients server will use its output stream buffer. Similarly other clients can also follow same method to do live web chatting.

CHAPTER 2

LITERATURE SURVEY

2.1 Chatting Application with Real Time Translation [ Sushma Shinkar,

Nikhil Chaudhari, Priyanka Pagare] - Bachelor of Engineering, Computer

Engineering Department, Sanghavi college of Engineering , Maharashtra,

India

These days social networking is very common thing which is performed by people. Social networking is the thing which not only deals with text or sentences but also deals with pictures which we have achieved to operate the picture for performing face detection and finding the expressions. In an organisation, colleagues working there can send and get reply of messages instantly in very less time without having face to face conversation, and in the mean time the report of work can be shared/sent instantly during the chat session. With this application it is possible to have virtual conference without getting all the people together in a meeting room physically present. Doing instant messages for company communication is more efficient than making phone calls or doing emails. Various clients can do chatting concurrently. Dependent on a conference call or doing electronic mail message for meeting with colleagues is time consuming, but with this application everybody can join and have a discussion on various topics in very less time. If you really want to have fast communication then this application is far better than e-mails. With the support of fast messages one can send a message and get response of message in very few seconds. This chat program is built in combination of two or more concepts by using Ionic Framework 3.6.0 which makes use of Angular 4.3.* and in order to store data we use database we have mongodb as Firebase and in backend programming we are making use of node.js Express.

Now, the architecture constitute of client and server module which include the given below steps:

  1. Initial step is to execute server program on server machine.
  2. After that client send request to server through its device and on that basis server give response to him/her and connection start taking place.
  3. When the client-server connection is successfully established, the server then broadcast a list to of its connected users to its each connected client.
  4. Client has the right to view all its active users and thus can make communication with them.
  5. Server establishes a separate connection for each of its connected client, for which server produces a personal thread for each client connection. Now this thread is responsible to send/receive data from and to clients.
  6. Whenever a client creates and sends a message to other client, this message initially is transferred to the server.
  7. Then the server transmits the following message to the desired receiver of user.
  8. Now, when the receiver client receives the message, receiver can read it.
  9. In reflection receiver can send back reply but again follow the process of same process as mentioned above.
  10. This chat application brings the use of concept of socket programming and the concept of multithreading. There will be different threads in it. One thread is for running server program and a different thread to control each client that wants to establish connection.

Figure 2. Figure 2.

  1. public Socket(InetAddress host, int port) throws IOException.
  2. public Socket(String host, int port, InetAddress localAddress, int localPort) throws IOException.

2.3 Java Socket Programming [ Java Point ]

Basically java socket programming is brought in use for communicating between different applications executing on various Java Runtime Environment. Java Socket programming can have two types of mediums to communicate. Communications can be connection-oriented or can be connection-less. If we talk about connection-oriented sockets then for those we have classes like Socket and ServerSocket while, for connection-less socket programming we have Datagram Socket and Datagram packet classes. The client who are doing socket programming should know two things about server:

  1. Client should know the IP Address of Server
  2. And Most importantly it should know the port number of server. Now here we are preparing to establish one-way client and server communication. Taking about this application, client/user transmits a message to the server, then server reads the message using read-line and then prints the message. Here basically we are making use of two classes that includes ServerSocket and Socket. The Socket class is brought in use to communicate between server and client. By using this class, we can do reading and writing of messages. In server program we have server-socket class. We have a method called accept() in ServerSocket class which blocks the console till the time the client is connected. When the client is successfully connected, it brings back the instance of Socket towards side of server. Basically a socket is an endpoint for communications between two devices. To create a socket we have socket class. Various essential methods in socket class which are use includes getinputStream(), getOutputStream(). In server socket class we have socket accept(), synchronised close().

Figure 2. The web chat application is based on client - server architecture within a Local Area Network. This client server model of doing computing is basically a distributed application that do pieces of tasks between the provider of resource or we can say that service called servers and service requesters are called clients. The Server side always would be continuously running service listening to a different - different clients enquiring its service. The servers will maintain database of users. Whenever a client makes login to the application, the Server immediately makes authentication of the user. Once the user is been authenticated the IP address of the client/user will registered to the list of the Server and user transmits that list of online client partners and remaining relevant data to the Client/user. When the client wants to have some chat with any other user, then that user’s IP address along with his Port address would be sent to the client and vice versa. So a connection would take place and the two clients would be able to chat with each other.

2.5 Design and Implementation of Client-ServerBased Application using

Socket Programming in a Distributed computing environment [Rolou

Lyn R. Maata, Ronald Cordova, Balaji Sudramurthy, Alrence Halibas ]

In this research we have a detailed discussion on client-server application with the use of socket programming in an environment where we have distributed computing. In this the researchers have programmed a client-server based application known as OpTel Billing System in short known as OBS on platform of java Netbeans and TCP datagram to explain the fundamentals of socket programming and is transmissions in distributed computing. Style of socket programming, design of interface, classes of java and exception handling are also considered part of development stage. Mainly the analysis by researcher was made on communication process between client and server by making use of socket programming. Also analysis and examination is done on classes used in this programming. According to these researchers, basically sockets of devices is a two-way link between client and sever codes which are executing in environment of network. It is a very efficient way of communication process. Figure 2. Figure 2.