Creating a Chat Server using Socket Programming and Multi-Threading in Python
Nilesh Mathur
Senior DevOps Engineer @ Rlabs Enterprise Services Ltd.|| Certified Mentor @ Expertrons || Gen AI Enthusiast || Ex-Calance || Ex- LTTS
Hello Everyone!!!!
This time our requirement is to create our own Chat Server and establish a network to transfer data using Socket Programing by creating both Server and Client machine as Sender and Receiver both.
In this, I will be using UDP(User Datagram Protocol).Also, for getting and receiving data parallelly, I will use concepts of Multi-Threading.
I will be using 2 different OS, one will be Windows and another will be Linux.
So, for creating a Python Program in Windows :-
Now, for creating a Python Program in Linux:-
Now, I will run both these programs simultaneously.
Now, we will be able to chat between 2 user systems.
This tasks causes some challenges as it is using UDP, ie. Connectionless
So, even if no one is receiving the message, user will keep on sending the data.
Solution to this challenge is TCP(Transmission Control Protocol) which will first setups the connection and then allows to send the message.
I will also create a Chat Server using TCP in sometime.
Software Developer
3 年wow! it was very helpful. thank you. ??
Electronics Engineer at Enercon
3 年Thanks! very helpful!!!