Question: 1. Write a java program to send file content from client to server and vice versa (i.e. two way communication). The responsibilities of the client

1. Write a java program to send file content from client to server and vice versa (i.e. two way communication).

The responsibilities of the client are as follows:

1. To take input for file name from keyboard. Remember, this file should exist on server. For this, it uses input stream.

2. The file read from keyboard should be sent to the server. For this client uses output stream.

3. The file contents sent by the server, the client should receive and print on the console.

The responsibilities of the server are as follows:

1. First job is to read the file name coming from client. For this, it uses input stream.

2. Second one is to open the file, using some input stream, and read the contents.

3. Third one is, as the reading is going on, to send the contents each line separately.

2. Write a Chat Program two way continuous communication using Java.

The client and the Server will have the following responsibility

1. Reading from keyboard. Uses an input stream like BufferedReader connected to System.in.

2. Sending data to the other system what is read from keyboard. Uses an output stream like PrintWriter connected to getOutputStream() method of Socket.

3. Receiving data from the other system. Uses an input stream like BufferedReader connected to getInputStream() method of Socket.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!