Authors: Atharva Jaid, Gaurav Durge, Ashutosh Joshi, Khomesh Kalambe, Hrishikesh Dhale
DOI Link: https://doi.org/10.22214/ijraset.2023.52621
Certificate: View Certificate
We have designed a chat application that involves multiple clients, utilizing a socket module to establish client-server connections. These sockets serve as internal terminals for data transmission and reception. Two sockets are present on every solitary network. TCP sockets are used in the implementation of this application . The socket has been attached to a localhost or a machine port. When a client is involved, a socket connection will be established with the server. The connection will be on the same port as the server-side code. The application is built to allow multiple clients to connect to a central server and exchange messages with each other in real-time. The implementation of the application includes the use of multi-threading, socket programming, and JavaFX for the user interface. The paper discusses the design and implementation of the chat application and provides an evaluation of its performance.
I. INTRODUCTION
Chat applications have become an integral part of our modern communication landscape. They enable real-time, interactive conversations among users across various platforms and devices. The rapid advancement of web technologies has revolutionized the way chat applications are built, with Socket programming emerging as a powerful solution for creating dynamic and efficient communication channels. A chat application that operates through socket programming allows for the creation of a server-client system, enabling multiple clients to engage in individual or group communication. This programming approach can be employed to develop various applications, such as medical interfaces, customer reporting and service organizations, and other programs that rely on this framework. Chat applications hold significant importance in our daily lives as they facilitate communication over the internet. However, one notable drawback of chat applications is their dependency on internet connectivity, which can be problematic in remote or rural areas lacking stable internet connections. To address this issue, a local communication solution can be implemented using the server-client architecture. This approach utilizes sockets, where clients can connect to a local host (server) and communicate with one another. In this setup, clients linked to the local host have the capability to exchange messages with all other connected clients. By employing this method, communication can be established among clients in the absence of internet connectivity, making it particularly beneficial for areas with limited or no access to reliable internet services. This local communication feature enhances the versatility and accessibility of chat applications, extending their usefulness beyond traditional internet-dependent scenarios. This paper aims to provide an introduction to developing chat applications using socket programming. We will explore the underlying concepts, architecture, and benefits of WebSocket technology, along with practical insights into building robust and scalable chat applications.
II. LITERATURE REVIEW
An IP Stack's low-level access point is represented by a socket object. The foundation of our solution for data sharing is the ability of a socket to send and receive data. You can have an open or closed socket [1]. Most chat programmes make use of TCP/IP socket programming. The WWW, FTP, peer-to-peer file sharing, and email systems all use this protocol. This protocol is built on top of SSL/TLS. TCP offers a dependable, error-checked, and sequential transport of data bytes[2]. Bamane [3] created a chat system with an added white board so the users can draw diagrams along with chat messages. It followed a client server architecture. Predictive texting feature was also added. Kundu[4] provides a decentralized chat system for the internet and intranet that was created in J2SE, Java Server Edition. It is a zero-configuration architecture that enables users to connect by only running the programme. An index table at the heart of the system alerts each user to the existence of other peers utilising the application via the network. The communication method is built on straightforward socket programming, with the Index detecting IP and Port Address. The network chat system design strategy proposed by CAI [5] is based on cloud computing and socket technology. The socket interface is a TCP/IP network application programming interface.
It defines a set of functions and routines that programmers may use to create TCP/IP network applications. To enhance network chat communication and the efficiency and security of data storage, particularly in socket-based applications, one can add cloud computing technology to the method's development. Another client server based system was proposed by Amber [6]. In order for clients to communicate with the server via an attachment module, many client connection points have been established. These attachments are located inside the endpoints where data is sent and received. Two attachments will be present in a single organization. TCP attachment is used to run this programme. Kumar et al[7] developed a web-based chat programme using Java, multi-threading, and the client-server model. For server-side processing, Node Js was utilised. The programme made use of Node's websocket and REST API components, and the front end was created utilizing various javascript frameworks. Gayathri et al [8] created a multi user chat using multithreading. JSP and servlet technology was used for the server side processing. Pasumarty et al [9] created a chat application with additional encryption to add security. A random cipher key is produced when the server is launched so that communications may be encrypted and decrypted. Within the confines of the system, this cipher key is the private, secret key. A communication that comes from a user is encrypted before it is transmitted to the server. The group chat server gets this encrypted message and sends it on to the other users that are currently logged in. Akshit et al[10] created a chat system which made use of UDP. Due to the absence of confirmation after transmitting a file and the lower assurance of a successful transfer, UDP is not recommended. It does, however, have certain benefits, such as multicasting and a fast transmission rate.
III. METHODOLOGY
The Java-based chat application using socket programming can be developed using the steps given below:
A. Let's Explore Each Step in Detail
B. Design Architecture
Fig. 1 shows the general multiple client-server architecture schema. In socket programming, the client-server architecture involves clients establishing socket connections with a central server. The server listens for incoming client connections, handles message exchange, and facilitates real-time communication between clients through their respective sockets. This architecture enables bidirectional and scalable communication between clients and the server. Fig. 2 shows the architecture of a chat application using socket programming.
Java Socket Programming provides a simple yet powerful way to enable communication between multiple devices over a network. In our chat application, we used Java Socket Programming to establish a connection between multiple clients and a central server. Each client runs on a separate thread, which allows for simultaneous connections and messages exchanges between clients.
Multi-threading is a programming technique that allows multiple threads to execute concurrently within the same program. In our chat application, we used multi-threading to ensure that each client runs on a separate thread, which prevents the application from freezing when handling multiple clients.
In our chat application, we have used JavaFX for creating the user interface. JavaFX is a powerful toolkit for creating graphical user interfaces in Java applications. Buttons, labels, text boxes and many other UI components are provided by the application. These can be easily customized and styled to match the design of the application.
To use JavaFX in our chat application, we first created a new JavaFX project in Eclipse. We then added a new class for the main window of the application, which is inherited from the Application class of Javafx. The UI components were created in the start() method of this class and then added to the main window. We also added event handlers to the UI components to handle user actions, as sending messages or closing the application.
One of the benefits of using JavaFX in our chat application is that it provides a responsive and intuitive user interface. We can use animations and transitions to provide visual feedback to the user, such as when a new message is received or when a client connects or disconnects from the server. JavaFX also provides support for CSS styling, which allows us to easily customize the appearance of the UI components.
Another benefit of using JavaFX is that it provides support for asynchronous programming through the use of the javafx.concurrent package. This allows us to perform time-consuming tasks, such as sending messages to clients or handling incoming messages, in the background without blocking the UI thread.
IV. RESULTS AND DISCUSSION
We have successfully developed a Java-based chat application using socket programming that supports multiple clients. The application allows clients to communicate with each other in real-time. The server maintains a list of all the connected clients Once it receives a message from any client, it sends the message to the other clients.
Fig. 4 and Fig. 5 in this research paper exhibit the graphical representation of the user interface (UI) of our chat application. These visual illustrations depict a visually appealing and user-friendly UI design, facilitating smooth and intuitive interactions among users. Users can update their profile and can smoothly send the messages. The design emphasizes seamless navigation and usability, fostering engaging and purposeful conversations.
V. CHALLENGES
WebSocket programming for chat applications can pose certain challenges including scalability for handling concurrent connections, ensuring security measures such as authentication and encryption, implementing robust error handling, addressing compatibility issues with older browsers, handling CORS that is Cross-Origin Resource Sharing (A security mechanism implemented in web browsers that restricts the sharing of resources such as data, APIs, or assets between different domains) restrictions, optimizing performance, and implementing effective load balancing techniques.
VI. ACKNOWLEDGEMENT
This work was partially supported by B.R.A.C.T’s Vishwakarma Institute of Technology, Pune. We thank our Project Guide for comments that greatly improved the project.
Java Socket Programming provides a simple yet powerful way to enable communication between multiple devices over a network. The use of multi-threading ensures that our chat application can handle multiple clients simultaneously without freezing. Additionally, the use of JavaFX provides a responsive and intuitive user interface, enhancing the overall user experience. Socket programming has revolutionized the development of chat applications by providing an efficient, real-time communication mechanism. This paper has provided an introduction to developing chat applications using Socket programming, covering the underlying concepts, architecture, benefits, practical implementation, future directions and challenges. By leveraging the power of socket technology, developers can create highly interactive, scalable, and responsive chat applications that redefine the way we communicate in the digital age. The chat application developed in this research paper can serve as a foundation for further development of chat applications with additional features such as file transfer, voice, and video chat. Further, it can be deployed as a web application and can be encrypted using different encryption models.
[1] Richard Steven, and Thomas Narten, “UNIX Network Programming”, ACM SIGCOMM Computer Communication Review 20.2 (1990): 8-9. [2] Vinton Cerf, and Robert Kahn, “A Protocol for Packet Network Intercommunication”, IEEE Transactions on communications 22.5 (1974): 637-648. [3] A, Bamane, P. Bhoyar, A. Dugar and L. Antony, “Enhanced Chat Application”, Global Journal of Computer Science and Technology 12.11-E (2012). [4] A. Kundu, “Decentralised Indexed based Peer to Peer Chat System”, 2012 International Conference on Informatics, Electronics & Vision (ICIEV). IEEE, 2012. [5] M. Cai, “The Design Method of Network Chat System based on Socket and Cloud Computing”, 2012 International Conference on Computer Science and Service System. IEEE, 2012. [6] A. Shah, M. G. Servar, U. Tomer, “Realtime Chat Application using Client-Server Architecture”, International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; Volume 10 Issue V, May 2022. [7] M. Kumar, V. Thakur, D. Gurjar, “Multi-User Web Chat Application using Node.js and Socket.io”, International Journal of Advanced Research in Science, Communication and Technology (IJARSCT) Volume 2, Issue 4, May 2022. [8] R. Gayathri, C. Kalieswari, “Multi-User Chat Application”, International Journal of Engineering and Advanced Technology (IJEAT) ISSN: 2249 – 8958 (Online), Volume-9 Issue-5, June 2020. [9] R. Pasumarty and R. P. K. N, “Secure Chat Room Application using Advanced Encryption Standard Algorithm,” 2021 International Conference on Disruptive Technologies for Multi-Disciplinary Research and Applications (CENTCON), Bengaluru, India, 2021, pp. 344-346. [10] A. Malhotra, V. Sharma, P. Gandhi and N. Purohit, “UDP based Chat Application”, 2010 2nd International Conference on Computer Engineering and Technology, Chengdu, China, 2010, pp. V6-374-V6-377.
Copyright © 2023 Atharva Jaid, Gaurav Durge, Ashutosh Joshi, Khomesh Kalambe, Hrishikesh Dhale. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Paper Id : IJRASET52621
Publish Date : 2023-05-20
ISSN : 2321-9653
Publisher Name : IJRASET
DOI Link : Click Here