Building Chat Application using Socket Programming in Python
- 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.
For this Problem Statement, we need two OS 😅.
First, we need to import socket(for socket programming) and threading(for Multi Thread programming). After that, I have used AF_NET(for IPv4) and SOCK_DGRAM(for UDP). After this Now we need System IP and Port and Client IP and Port. I have made two functions one for the sender and one for the receiver. sendto(for sending msg) and recvfrom(for receiving msg).Final step, use threading concepts to runs these functions in parallelism 🚀.
Note: This program is based on UDP Protocol, if u connect more than 1 client the messages will be messed up 😕. For solving this issue use TCP 😃 .