Develop an application to do the following: 1. Client read a line of characters (data) from its keyboard and send the data to the server. 2. The server receives the data and converts characters to uppercase. 3. The server sends the modified data to the client. 4. The client receives the modified data and displays the line on its screen.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
using paython pycharm
 
 
Develop an application to do the following:
1. Client read a line of characters (data) from its keyboard and send the data to the server.
2. The server receives the data and converts characters to uppercase.
3. The server sends the modified data to the client.
4. The client receives the modified data and displays the line on its screen.
Transcribed Image Text:Develop an application to do the following: 1. Client read a line of characters (data) from its keyboard and send the data to the server. 2. The server receives the data and converts characters to uppercase. 3. The server sends the modified data to the client. 4. The client receives the modified data and displays the line on its screen.
Expert Solution
Step 1: Algorithm :

Server Algorithm:

1. Create a socket object for the server.
2. Bind the socket to a specific address and port (e.g., localhost:12345).
3. Listen for incoming connections.
4. Display "Server is listening for connections..." message.

Loop:
5. Accept a connection from a client, establishing a client socket and client address.
6. Display "Connection established with [client_address]" message.

Sub-Loop:
7. Receive data from the client (up to 1024 bytes).
8. If no data is received, exit the sub-loop.
9. Convert the received data to uppercase.
10. Send the modified data back to the client.
End of Sub-Loop.

11. Close the client socket.
End of Loop.

Client Algorithm:

1. Create a socket object for the client.
2. Connect to the server at a specific address and port (e.g., localhost:12345).

Loop:
3. Prompt the user to enter a line of characters or 'exit' to quit.
4. Read the user's input.
5. Send the input data to the server.

6. If the input is 'exit', exit the loop and close the socket.
7. Receive the modified data from the server (up to 1024 bytes).
8. Display the modified data on the screen.

End of Loop.

9. Close the client socket.

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Running Time of Application
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.
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education