Arth2020 Task17

Arth2020 Task17

In this article we are going to create chat program using python socket programming and Threading.

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.

Prerequisite

  • we need two system, one for server and another for client. I have used one Redhat 8 OS and one Windows OS respectively.
  • In both the system python should be install.

Socket Programming

Socket programming is a way of connecting two nodes on a network to communicate with each other. One socket(node) listens on a particular port at an IP, while other socket reaches out to the other to form a connection. Server forms the listener socket while client reaches out to the server.

Lets begin...?.

Step 1:- Run ifconfig enp0s8 to see the ip address of Redhat 8 OS.

No alt text provided for this image

Step 2:- Run ipconfig to see the IP address of Windows OS.

No alt text provided for this image

Step 3 :-

Create one file in Redhat 8 OS name as server.py and create another file in Windows OS name as clientA.py .

No alt text provided for this image

Step 4:- write the code for server side python program for socket programming.

No alt text provided for this image
  • In the above image I have imported two module socket and Thread.
  • I have provided the RedHat IP in the serverip varible and Windows IP in ip variable.
  • Note:- In Windows OS, socket programming run on port no 10048 and in Redhat OS we can give any IP address.
  • Then I have created two Thread so that we can send and receive message parallelly.

Step5:- write the code for client side python program for socket programming.

No alt text provided for this image
  • Above code is approximately same as the server side code only difference is in the s.bind section.

Step 6:- Now lets run both the python file.

No alt text provided for this image

Now chat server is created we can use this for chatting.

No alt text provided for this image

Its done...









Aman Kumar Abhishek

Student at ARTH - The School of Technologies

4 年

Thanks for sharing ??

要查看或添加评论,请登录

Km Sulekha的更多文章

  • Docker GUI Task26

    Docker GUI Task26

    This article describe how we can launch GUI software on Docker. Task Description *GUI container* on the *Docker* Launch…

  • HotStar Case Study Task2

    HotStar Case Study Task2

    This article will describe the journey of Hotstar’s infrastructure from EC2 to Kubernetes. The journey about why, what,…

    1 条评论
  • Case Study of AWS SQS

    Case Study of AWS SQS

    In this article I am going to share what is Amazon SQS and industries use case of Amazon SQS. Amazon SQS Amazon Simple…

  • ARTH Task18

    ARTH Task18

    In this article we are going to explain how to we can configure WordPress on ec2 instances and connect this with Amazon…

  • Create a setup so that you can ping google but not able to ping Facebook from same system Task13

    Create a setup so that you can ping google but not able to ping Facebook from same system Task13

    This article is to explain how we can create an interesting networking setup in which only we can reach to google but…

  • How big MNC's like Google , Amazon etc stores, manages and manipulate Thousands of Terabytpes of data with High Speed and High Efficiency Task-1

    How big MNC's like Google , Amazon etc stores, manages and manipulate Thousands of Terabytpes of data with High Speed and High Efficiency Task-1

    In a world where competition is intense, users will simply dump you, if your app slows down or freezes. So your…

  • Industries use case of AKS ?

    Industries use case of AKS ?

    Kubernetes is by far the most popular container orchestration tool, yet the complexities of managing the tool have led…

  • Ansible-Tower

    Ansible-Tower

    In this 3 hours of session we learn practical demo how industries are using Ansible-Tower and how it gives lots of…

  • Arth2020 task12

    Arth2020 task12

    This article is to explain how to configure a highly automated setup for Reverse proxy i.e Haproxy and update it's…

    5 条评论
  • How industries are solving challenges using Ansible

    How industries are solving challenges using Ansible

    Companies using Ansible We have data on 8,781 companies that use Ansible. The companies using Ansible are most often…

    2 条评论

社区洞察

其他会员也浏览了