
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
I need the Server code written in Python for the given client code.
A sample working client code is given to you in Client.py. I need a corresponding Server code. The goal of the server is to get any string sent to it, and switch any letters from lower case to capital and vice-versa. Lastly it should then close gracefully when the client is done sending strings. The client code is provided below:
import argparse
from sys import argv
import socket
#First we use the argparse package to parse the aruments
parser=argparse.ArgumentParser(description="""This is a very basic client program""")
parser.add_argument('-f', type=str, help='This is the source file for the strings to reverse', default='source_strings.txt',action='store', dest='in_file')
parser.add_argument('-o', type=str, help='This is the destination file for the reversed strings', default='results.txt',action='store', dest='out_file')
parser.add_argument('server_location', type=str, help='This is the domain name or ip address of the server',action='store')
parser.add_argument('port', type=int, help='This is the port to connect to the server on',action='store')
args = parser.parse_args(argv[1:])
#next we create a client socket
client_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_addr = (args.server_location, args.port)
client_sock.connect(server_addr)
#now we need to open both files
with open(args.out_file, 'wb') as write_file:
for line in open(args.in_file, 'rb'):
#now we write whatever the server tells us to the out_file
client_sock.sendall(line)
answer = client_sock.recv(512)
write_file.write(answer)
#close the socket (note this will be visible to the other side)
client_sock.close()
Some output pictures would be appreciated to make sure that the code works properly. Thank You.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- You write "call puts wrt ..plt" and assemble, link, and run the code. a. What does the call point to? b. What does the PLT entry point to? c. What does the GOT entry point to? d. Who fills in the PLT entry? The assembler, the linker, or the loader? e. Who fills in the GOT entry? The assembler, the linker, or the loader?arrow_forwardQUESTION 1 • Develop a server program in Java that waits for clients to connect. The server responds to the client to choose one of the following options available with server and then deliver the requested object to client o Certificate • Secret Key • Message Digest o Digital Signature • Server Program is first started. • Then the Client program is started. Execute the following steps: Step 1: Run the Java program of Server Step 2: Run the Java program of Client and display the Sample output of Client Window as communicated to the server and response from the server Task: 1. Write the Java socket program for the Server. (class name: Server_Your ID Number) Task: 2. Write the Java socket program for the Client. (class name: Client_Your ID Number) Task: 3. Execute the program and show the output screenshot. Attach File Browse My Computerarrow_forwardin C++ generate a histogramLinks to an external site. of 20,000 randomly generated integer numbers according to a normal distribution with a user-specified mean and standard deviation. Your histogram will include the frequencies of at least 9 data points centering at the mean value: mean +/- x*stdDev, where x is in {0, 1, 2, 3, 4}. For example, given mean=1 and standard deviation of 2, you will calculate the frequency of at least the following values: 1-4*2, 1-3*2, 1-2*2, 1-2, 1, 1+2, 1+2*2, 1+3*2, 1*4*2.arrow_forward
- HOW TO DO THIS path FUNCTION IN C PROGRAMMING HELP!!! Add a new built-in path command that allows users to show the currentpathname list, append one pathname, or remove one pathname. In your shellimplementation, you may keep a data structure to deal with the pathname list.If you do not use execle() or execve() that allows you to execute withyour own environment variables, you will need to add it to the “real” PATHenvironment variable for executables in the path to work correctly. The initialvalue of path within your shell shall be the pathname list contained in the PATHenvironment variable. Implement the path command as follows:• path (without arguments) displays the pathnames currently set. It shouldshow pathnames separated by colons. For example, "/bin:/user/bin".• path + ./bin appends the pathname to the path variable. You mayassume that only one pathname is added at a time.• path - ./bin removes the pathname to the path variable. You mayassume that only one pathname is removed at…arrow_forwardWe are trying to find out more information about the GET-PROCESS: What cmdlet can we run if we want to access the help file of GET-PROCESS with more than just the basic default information, and it will show which parameter is required. What cmdlet can we run if we want to view the online version of the help file of GET-PROCESS. What cmdlet can we run if we want to find out if there is an Alias for GET-PROCESS. What cmdlet can we run if we want to display a GUI pop up window for GET-PROCESS that allows us to run/copy the cmdlet. Please write down the complete cmdlet with all required parameters and switchparameters.arrow_forwardIn this programming assignment, you will implement the above ROS smart mobility system in city. create a service that the ROS service client node will send the GPS location of the autonomous vehicle. Consequently, the ROS service server will send back the current weather status by using c/c++arrow_forward
- Write a client program for MyTime which loops around getting strings fromthe user representing times and responding with a greeting such as “goodmorning” as appropriate. The user should enter the string “quit” to exit theprogram. EXAMPLE run of client:USER: 2:07 pmPROGRAM: good afternoonUSER: 10:71 amPROGRAM: that’s not a valid time, please re-enterUSER: 14:30amPROGRAM: that’s not a valid time, please re-enterUSER: 10:21amPROGRAM: good morningUSER: 7:00 pmPROGRAM: good evening the set method for MyTime should detect inputstrings which do not represent valid times. An exception should be thrown insuch a case. Clients will haveto handle (or catch) the exceptions. Thus you will have to also write your own exception class which can be used by MyTime and the client class. Here are my code: public class MyTime { private String time; public String getTime() { return time; } public void setTime() throws InvalidTime { String time = askTime(); if (time.equalsIgnoreCase("quit")) {…arrow_forwardThis question was rejected because lack of a text file, which I do not see a way to upload. I saved the first part of the file as an image because that is all I can upload. If that doesn't suffice, please advise how to include a text file. In C++, I would like some help improving or making a better password lookup function for a Hash Table class/program I made, The function: it is supposed to lookup a user password using their ID and name which I read in from a text file. The one I have only works for the first 10 records, which I highlighted below in the program. string lookupPassword (string inUserID, string inUserName){ string thePassword; ... return thePassword; } Here is part of the program thus far: // Hash.cpp #include <iostream>#include<string>#include<iomanip>#include<fstream>using namespace std;//node classclass nodeBST {private: //user data string userID; string userName; string userPW; //BST left and right children nodeBST*…arrow_forwardIn this project, you are required to do socket programming in C language (Linux environment) to implement a pair of client and server that can achieve simple password verification to indicate the current market value of the stock. Your client will send a pair of username and password to your server and your server will verify whether the pair of username and password is legitimate or not for retrieving the stock value. Assume the only legitimate pairs of usernames and passwords that will be accepted by your server are as follows. Username Password StockValuelcid welpa23e 13.93mrvl ghqwo31a 41.23snap tyjli14d 10.21cl1 rjwqe83f 85.09bro gnmds28z 56.43cvs rhktl87c 91.34 StockFile.txt Specifically, your client and server programs entail to achieve the following requirements:1. Your client program…arrow_forward
- Create two separate Python scripts. The Client programme sends the Server programme an arbitrary string across the network. After parsing the Client String, the Server application will append the "Back to You" string to it before sending the whole thing back to the Client.arrow_forwardPlease do not use a python code already on the internet. The following code must be written in python for this HW assignment. I will provide a skeleten for the code and you must write some lines of code to satisfy the objective of the prorgram. you need to develop a web server that handles one HTTP request on at a time. the web server should acceptand parse the HTTP request, get the requested file from the server’s file system, and create an HTTP responsemessage consisting of the requested file preceded by header lines, and then send the response directly tothe client. If the requested file is not present in the server, the server should send an HTTP “404 NotFound” message back to the client. Dont need the hole code just right the information and code it to the skeleten pictures below.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education