Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

home / study / engineering / computer science / computer science questions and answers / #UDP Client #Python UDP Client From Socket Import* #python's Socket

home / study / engineering / computer science / computer science questions and answers / #UDP Client #Python UDP Client From Socket Import* #python's Socket Library ServerName = '127.0.0.1'...

Your question has expired and been refunded.

We were unable to find a Chegg Expert to answer your question.

Question: #UDP client #Python UDP Client from socket import* #python's socket library serverName = '127.0.0...

#UDP client #Python UDP Client

from socket import* #python's socket library

serverName = '127.0.0.1' #hostname:127.0.0.1

serverPort = 95950 #pick a random number as well

clientSocket = socket(AF_INET, SOCK_DGRAM) #create UDP socket for server

message = raw_input('Input lowercase sentece:') #get user input

clientSocket.sendto(message,(serverName,serverPort)) #attach server name, port to message; send into socket

modifiedMessage, serverAddress = clientSocket.recvfrom(2048)

print modifiedMessage #print out received string

clientSocket.close() #all close socket

----------------------------------------------------------------------------------------------------------------

#UDP server #Python UDP Server

from socket import*

serverPort = 95950 #match the number with client

serverSocket = socket(AF_INET, SOCK_DGRAM)

serverSocket.bind(('95950', serverPort))

print 'The server is ready to receive'

while 1:

message, clientAddress = serverSocket.recvfrom(2048) modifiedMessage = message.upper() serverSocket.sendto(modifiedMessage, clientAddress) ---------------------------------------------------------------------------------------------------

image text in transcribed

athena.ecs.csus.edu PuTTY [daij@athena:24]> python server.py The server is ready to receive Server side snapshot athena.ecs.csus.edu PuTTY [daij@athena: 24] python client.py Input lowercase sentence:hello, world! HELLO, WORLD! [daij@athena: 25]> athena.ecs.csus.edu PuTTY [daij@athena:24]> python server.py The server is ready to receive Server side snapshot athena.ecs.csus.edu PuTTY [daij@athena: 24] python client.py Input lowercase sentence:hello, world! HELLO, WORLD! [daij@athena: 25]>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago