Chatting Application using Python

Task Description 👨🏻‍💻

  • Create your own Chat Servers, and establish a network to transfer data using Socket Programing by creating both Server and Client machine as Sender and Receiver both. Do this program using UDP data transfer protocol.
  • Use multi-threading concept to get and receive data parallelly from both the Server Sides. Observe the challenges that you face to achieve this using UDP.

Note: Machines must have different OS like One Linux Machine one Windows. Both machines must be configured with python.

So I have used two OS, one Redhat Linux and the second is Windows.

  • Redhat OS whose ip is 192.168.29.121 is serving as a client. I named it Chirag’s Chat.
Redhat
  • Windows whose ip is 192.168.29.223 is serving as a server. I named it Karan’s Chat.
Windows

So in the below image, there are two programs named client.py and server.py in Redhat and Windows respectively.

This is the code of client-side, i.e, on the side of Chirag:

This is the code of server-side, i.e, on the side of Karan:

After running these two programs, as they are running on UDP, they will ask each other’s IP:

So these two systems are ready to chat!!!!

So at last there is the chat between the two friends:

This program will automatically end when both users will say ‘bye’.

You can find the code here.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

LeetCode #283 “Moving Zeroes”

Why Does Everybody Want to Use Kubernetes?

Let’s know all about the hashMap in Java

Linux on Intel Atom Tablet

Using modern tooling to find a tough Linux kernel bug

python🐍 — Make a salary receipt

What happens when you type ls *.c in your Shell

What if Reddit and Slack had a baby?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Karan Agrawal

Karan Agrawal

More from Medium

Customize keyboard shortcut keys using python

Flask, from zero to hero: the complete tutorial (work in progress).

AQI (Air Quality Index) Web Application

Reading the latest WhatsApp messages with python