👨‍💻Task 17👨‍💻

👨💻Task 17👨💻


🔅 Create your own Chat Servers, and establish a network to transfer data using Socket Programing by creating both Server and Clinet 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.

🧑‍💻 Solution:-

Step 1: First check The IP of System A

No alt text provided for this image

Step 2: Check The IP of system B

No alt text provided for this image

Step 3: Write A python Code for Socket programing

 
	#!/usr/bin/env python
	

	import socket
	

	send = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
	recv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
	

	recvIp = "192.168.80.131"
	recvPort = 8484
	toSendIp = "192.168.80.132"
	toSendPort = 8484
	

	recv.bind((recvIp, recvPort))
	

	while True:
	    send.sendto((input("Enter msg: ").encode()), (toSendIp, toSendPort))
	    x = recv.recvfrom(1024)
	    clientip = x[1][0]
	    msg = x[0].decode()
	    print(clientip + " :" + msg)
	   

Step 4: Copy the same Code in both systems

No alt text provided for this image

Step 5: Change in the code for system A

No alt text provided for this image

Step 6: Change in the code for system B

No alt text provided for this image

Step 7 :- Run Program in system A and System B

No alt text provided for this image
No alt text provided for this image

GitHub URL:-

Thank You

To view or add a comment, sign in

More articles by Shubham Jangid

  • Restarting HTTPD Service is not idempotence in nature and also consume more resources suggest a way to rectify this challenge in Ansible playbook

    What is an ansible-playbook? An Ansible® playbook is a blueprint of automation tasks—which are complex IT actions…

    1 Comment
  • 👨💻Task 12.1👨💻 Use Ansible playbook to Configure Reverse Proxy

    . Haproxy and update it's configuration file automatically on each time new Managed node (Configured With Apache…

  • अर्थ Program Task - 3

    Task Description - ARTH 👨🏻💻 🔅 Create a key pair 🔅 Create a security group 🔅 Launch an instance using the above…

    2 Comments
  • OS BASED PROGRAM INTO MENU DRIVEN PROGRAM

    "Created a OS based program into menu driven program using python code which will execute the required user query when…

    7 Comments
  • DevOps Task 4

    Create Dynamic Cluster of Jenkins And perform task 3 using the dynamic Jenkins Cluster. Step 1: Run Jenkins and install…

  • DevOps Task 6

    Step 1: Create a Docker file which have Jenkins and Kubernets Step 2: Build the Dockerfile docker build -t…

    2 Comments
  • DevOps Task-5

    Integrate Prometheus and Grafana and perform in following way: First Start node_exporter in RHEL8 for monitoring Step…

    1 Comment
  • Task-3 DevOps

    1. Create container image that’s has Jenkins installed using dockerfile 2.

  • Task-2 MLOps and DevOps

    1. Create container image that’s has Jenkins installed using dockerfile 2.

  • MLOps and DevOps task 1

    Task 1 : Automate merging the developer branch to master branch after being check by QA team Job 1: when developer push…

Explore content categories