Design and Implement Chat Program Using TCP/IP: April 2019
Design and Implement Chat Program Using TCP/IP: April 2019
net/publication/332565442
CITATION READS
1 3,914
1 author:
Mohammed A. Ahmed
College of Engineering, Al-Iraqia University
7 PUBLICATIONS 11 CITATIONS
SEE PROFILE
All content following this page was uploaded by Mohammed A. Ahmed on 15 April 2021.
Abstract - LAN Chat Messenger using TCP/IP offers reliability, Nowadays, we can see the old bureaucracy in many
security and zero cost communication among staff members of a organizations facilities although of the advancements of
company. As well, this study offers file transfer. It helps to solve the communication and network technology. Actually, these
communication problems that related to time and cost. The proposed organizations did not adopt new pattern of communication
protocol facilitates information exchange among individuals by
providing many communication options. It is a standalone
between staff members besides not comprehending the concept
application using JAVA as the programming language and tested at of Instant Messaging Service. The basic pattern of
LANs of our institute (college's Labs networks). communications realized by relying on the conventional
methods of communication, as example, the staff members walk
Keywords - LAN; FTP; UDP; Chat; TCP; IP. from office to office to conduct the required communication. In
addition, the staff may use mobile phone calls, which is costly
and stressful to communicate between each other. Some
I. INTRODUCTION organization might deal with emails to send work-based
information. But in this case, the intended receipt must be online
The objective of this work is to visualize the history of in order to check and read message [2]. The advances in
communication via focusing on important technologies through electronic messaging services and its synchronous nature can
previous decades. The elements of communication here are bring different advantages via improving business activities,
basically which from the pillars of communication history are save cost, energy and time. It also takes place in different forms
telephone, mail and telegraph. The Internet has introduced the such as speech, text, signals and the likes. It can also be said to
opportunity to form the cloud of “digital convergence” which be a conceptual way of exchanging information between entities
covers communications, computing and broadcasting in a single [3]. This paper is structured as follows: Section 2 of this
coherent system within a global network. The variation between research discusses about the project interface. Section 3
broadcast communication and point-to-point communication describes how the client connected to server. Section 4 is the
began to blur through the previous few decades. Point-to-point project’s protocol. Section 5 gives the output of project’s
machine-mediated communications have been realized by implantation. Finally is the conclusion of the research or the
introducing voice response and answering machines. Net news project.
which is facilitated though personal web pages have opened the
gate to cover large audience and thus, large audience can be
covered. We can expect this evolution of communications to
continue, and eventually to achieve that convergence in which II. THE PROJECT INTERFACE
there will be a continuum between point-to-point and broadcast A. GUI Server
communication. A common feature of all communication Figure1 represents server GUI (interface) which consists of
services has been that prices have usually had only a slight text area, four button and text filed. When server starts working
relation to costs. Average prices have, over long periods, the start button, stop button, online users’ button and clear
decreased in line with the decline in costs. However, the button appear in disable mode. The server cannot start working
structure of prices has traditionally included crosssubsidies. It is without a port number, the start button still disable until the port
often difficult to tell when such subsidies exist. One could hope number is entered, the port number should be between (0 to
that at least the economics of postal systems would be well 1024). By clicking on start. the text area will display the date,
understood. These systems are large, relatively slowly changing, port number and host name, the start button became disable and
and unusually open to public scrutiny .Many telephone all other buttons become enable. The server wait for client to
administrations have made great mistakes in their assessment of connect, text area display all connected and disconnected users.
the future development of telecommunications. They have been The stop button responsible for closing all sockets. The online
altogether too pessimistic concerning the possibilities of users button responsible for displaying online users. The clear
expansion. Both as regards number of subscribers, telephones, button used for clear text area.
and traffic, certain saturation values were assumed at an early
stage. These values have constantly proved to be too low [1].
doi:10.25195/2017/4417 | 31
Iraqi Journal for Computers and Informatics Vol. [44], Issue [1], Year (2018)
B. GUI Client
Figure2 represents client interface which consists of four
text field for user name (which represents current user name),
address (which represents host name of IP address), port (which
represents port number) and message to be send and three
button for connect, disconnect and send and text area to display
the messages and jlist (which displays online users). To allow
client connect to server must enter username, port number and
address of server, then click on connect button, if one of this
field empty the client ask user to enter the empty field, if the
username is already connected to the server, the server ask client
to change username. The disconnect button is enable when
client is connect and connect button became disable. When
client is connect the port, address and username is unable to
change (text field is unable) until client is disconnected also
Fig.3: Private Client Interface
cannot close the frame without click disconnected button. The
Send button responsible for sending messages. jlist displays all
By clicking on any username listed in jlist in order to start
connected users, Which enables the current user to chat
a private conversation. The frame shown in Figure3 well
privately with any another user by click on his/her name, the
display to each of them: The frame contains three buttons to
first name on jlist is the username of client and don’t do any
send messages, files and to close connection. The text area
action when press on it.
display conversation and a text field to write messages
doi:10.25195/2017/4417 | 32
Iraqi Journal for Computers and Informatics Vol. [44], Issue [1], Year (2018)
No
Send message to specific
Send file to specific user
username(online)
Add to existing that’s mean:
Public?
End connection of two
user
side of private chat
No
No
No
Send file to all online users
No
Public?
Public?
me?
Exist
Yes
Yes
Yes
Yes
keys in server:
Yes
Yes
Establish connection
Key=“disconnect”?
Key=“c
onnect
Key=“c
hat”?
pw”?
Start
”?
No
No
doi:10.25195/2017/4417 | 33
Iraqi Journal for Computers and Informatics Vol. [44], Issue [1], Year (2018)
Keys in client:
• “chat”: make client display the message to user (used
in public chat)
• “list”: when client receive “list”, that’s mean the new
client is connected or some client is disconnected so
the client update the list of online users.(used in
public chat)
• “done”: clear the arraylist of online user to be ready
for new list of online user when new user is connect
or disconnect.(used in public chat)
doi:10.25195/2017/4417 | 34
Iraqi Journal for Computers and Informatics Vol. [44], Issue [1], Year (2018)
Ⅵ - CONCLUSION
The proposed protocol solved the communication
problem among staff members and reduces time of
communication with no cost. The LAN Chat Messenger
supports many chat types
like (private chat with more than one online user) and (public
chat which enable a group of online user to chat together)
without internet connection. This LAN Messenger allows
files exchange as well in the same local connection.
Acknowledgement
I would like to thank my students (Sara, Lara and Liqaa) for [4] Tommy Mattsson ,“A Peer-To-Peer based chat system”,
their hard work of one year to produce this project as a thesis UPPSALA University- Department of Information
requirement of graduation from network engineering Technology.,2012.
department (B.S degree). [5] Hamdan O. Alanazi, Rafidah Md Noor ,“The Guide of
Implementing Chat Protocol: Study Case on Using the
Socket Programming Concept and Object Oriented
REFERENCES Programming”, JOURNAL OF COMPUTING, VOL. 2,
2010.
[6] A. A. Sawant and B. B. Meshram, “Network programming
in Java using Socket,” vol. 3, no. 1, pp. 1299–1305, 2013.
doi:10.25195/2017/4417 | 35
Iraqi Journal for Computers and Informatics Vol. [44], Issue [1], Year (2018)
doi:10.25195/2017/4417 | 36