Question

2. You are going to build a simple client-server system. The client and server protocol as follows: Server Program is first started. Then the Client program is started. The client connects to the server and then server asks the user for to send the file. The user's input is sent to the server via the connected socket. The server reads the user's file from the client socket. Then server request another file The client then sends the file to the serve until server say thank you 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. Execute the following steps: Step 1: Run the java program of Server. Step 2: Run the java program of Client and Sample output of Client Window: Sample output 1 (Client): Connected to server. Upload the file to the server: filel.txt Reply from Server: Send another file Upload the file to the server: file2.txt Reply from Server: Thank you Sample output 1 (Server): Connected to client socket number 13 Client sent file: filel.txt File Count 1 Reply to Client: Send another file Client sent file: file2.txt File Count 2 Reply to Client: Thank you

          2. You are going to build a simple client-server system. The client and server protocol as
follows:
Server Program is first started.
Then the Client program is started.
The client connects to the server and then server asks the user for to send the file. The
user's input is sent to the server via the connected socket.
The server reads the user's file from the client socket. Then server request another file
The client then sends the file to the serve until server say thank you
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.
Execute the following steps:
Step 1: Run the java program of Server.
Step 2: Run the java program of Client and Sample output of Client Window:
Sample output 1 (Client):
Connected to server.
Upload the file to the server: filel.txt
Reply from Server: Send another file
Upload the file to the server: file2.txt
Reply from Server: Thank you
Sample output 1 (Server):
Connected to client socket number 13
Client sent file: filel.txt
File Count 1
Reply to Client: Send another file
Client sent file: file2.txt
File Count 2
Reply to Client: Thank you
        
Show more…
2. You are going to build a simple client-server system. The client and server protocol as
follows:
Server Program is first started.
Then the Client program is started.
The client connects to the server and then server asks the user for to send the file. The
user's input is sent to the server via the connected socket.
The server reads the user's file from the client socket. Then server request another file
The client then sends the file to the serve until server say thank you
Task: 1. Write the java socket program for the Server. (class name: ServerYour ID Number)
Task: 2. Write the java socket program for the Client. (class name: ClientYour ID Number)
Task: 3. Execute the program and show the output screenshot.
Execute the following steps:
Step 1: Run the java program of Server.
Step 2: Run the java program of Client and Sample output of Client Window:
Sample output 1 (Client):
Connected to server.
Upload the file to the server: filel.txt
Reply from Server: Send another file
Upload the file to the server: file2.txt
Reply from Server: Thank you
Sample output 1 (Server):
Connected to client socket number 13
Client sent file: filel.txt
File Count 1
Reply to Client: Send another file
Client sent file: file2.txt
File Count 2
Reply to Client: Thank you

Added by Stephen M.

Close

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
Text: Using DrJava with Explanation
Close icon
Play audio
Feedback
Powered by NumerAI
Ivan Kochetkov Kathleen Carty
Jennifer Stoner verified

Akash M and 95 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
develop-a-java-application-that-includes-a-java-client-and-a-java-server-each-of-them-should-run-in-its-own-command-window-and-communicate-via-a-tcp-connection-on-two-computers-note-that-you-02694

Develop a Java application that includes a Java client and a Java server. Each of them should run in its own command window and communicate via a TCP connection on two computers. Note that you need to collect results of this project using two separate computers. The server and the client should be started in the following format: > java server > java client [IP-address] [input-data-file] [output-data-file] For example: java client 192.168.0.5 data10000B.txt out10000B.txt The client will read the first input argument (args[0]) to get the IP address of the server, and the second input argument (args[1]) to get the name of the input-data-file. The output-data-file (args[2]) should contain the same data as the input-data-file that the server sends back to the client. All the server does is listen to incoming socket connections, and once a connection is established, simply echoes all incoming data back to the sender. Note that you need to make sure you read the whole file before you send anything, send the entire message in one operation, and flush the stream after sending. (a) After establishing a socket connection with the server, the client will determine the estimated Round Trip Time (RTT) between the server and itself. The client will accomplish this by sending messages (the content of the 1B data file: data1B.txt) to the server and counting the time elapsed before it receives the messages back from the server. Run the client 3 times for the same input-data-file and then average their results to come up with an average RTT value. Do NOT count the time that the client spends on reading data from the input-data-file or writing data to the output-data-file.

Akash M.

need-huge-help-with-server-programming-java-programming-create-two-2-programs-1-an-iterative-single-threaded-server-that-accepts-requests-from-clients-and-2-a-multi-threaded-client-capable-o-17852

Need huge help with Server programming JAVA PROGRAMMING Create two (2) programs: 1) an iterative (single-threaded) server that accepts requests from clients, and 2) a multi-threaded client capable of spawning numerous client sessions that connect to the server. The server and client programs must connect to the same network address and port. The iterative (single-threaded) server should handle one client request at a time (serially). The Java ServerSocket object caches client requests automatically. The iterative (single-threaded) server must support the following client requests: 1. Date and Time - the date and time on the server 2. Uptime - how long the server has been running since last boot-up 3. Memory Use - the current memory usage on the server 4. Netstat - lists network connections on the server 5. Current Users - list of users currently connected to the server 6. Running Processes - list of programs currently running on the server Create a multi-threaded client that transmits requests to the server on a specified network port. The client program must be able to spawn multiple client sessions. When the server program is launched, the server should: - Listen for client requests on the specified network address and port - When a client request is received, the server should: - Determine which operation is being requested - Perform the requested operation and collect the resulting output - Reply to the client request with the output from the operation performed - Perform any necessary clean up activities - Go back to listening for client requests When the client program is launched, the client should: - Request the network address and port to which to connect - Request the operation to request (refer to the list above) - Request how many client requests to generate (1, 5, 10, 15, 20, and 25) - Collect the following data: - Turn-around Time (elapsed time) for each client request - The time required for the client request to travel to the server, be processed by the server, and return to the client - Total Turn-around Time (sum of the turn-around times for all the client requests) - Average Turn-around Time (Total Turn-around Time divided by the number of client requests)

Akash M.

advanced-java-programming-1sockets-in-java-come-in-at-least-three-varieties-that-are-implemented-by-the-socket-datagramsocket-and-serversocket-java-classes-the-first-two-socket-classes-repre-16086

Sockets in Java come in at least three varieties that are implemented by the Socket, DatagramSocket, and ServerSocket Java classes. The first two socket classes represent TCP and UDP communications respectively. The first two socket classes are used to implement both clients and servers. The ServerSocket class is only used to implement servers. Explain these three Java classes, comparing each other, and define the low-level mechanism of socket programming.

Akash M.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,799 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,520 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,381 solutions

*

Transcript

-
00:01 Hello students, so let us look at this question.
00:06 So the component that we would be using in making the application of java client -server communication would be first server and second it would be client.
00:22 So server basically listens for incoming socket connection, equals the received data back to the sender.
00:30 So it listens incoming socket communication and resends the data and sends the data to sender.
00:54 Sends the data to sender and coming on to the client, it connects to the server and it calculates the round trip time, calculates rtt that is round trip time by sending the message and receiving them back.
01:21 And for users, it was components coming on users part.
01:33 So it also would be divided into server and client.
01:37 So the role of server in users would be to run the command with java server, run command that is cmd with java server and the role of the client would be to run the command, run command with java client ip address, ip address...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Join the community

18,000,000+

Students on Numerade


Trusted by students at 8,000+ universities

Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever