Socket Object

Question 1 30 pts

(TCO 2 and 4) Write the listenSocket method (server-side program)
a – Write the required lines of code that will create a ServerSocket object with a port number 1024 on which the server program is going to listen for client communications.

b – Write the required lines of code that will create a new socket object.

c – Write the required lines of code that will read the data sent over the socket connection from the client program.

Copy the above code into the method below:
public void listenSocket(){
// PART A

//PART B

// PART C

}

Question 2 30 pts

(TCO 2 and 4) Write the listenSocket method (client-side program) with the hostname mydevry1 and port number 1024. Write it to send the data over the socket connection to the server and read the text sent by the server back to the client.

Question 3

In this discussion, you will provide a scenario that requires that you create a class. Explain your scenario and provide the source code for your class and ensure that the class contains the following components:

  1. at least 2 instance variables
  2. a constructor that takes as input the two instance variables
  3. two getter methods to obtain the current value of the instance variables
  4. two setter methods to update the instance variables.

Do you need help with this assignment or any other? We got you! Place your order and leave the rest to our experts.

Quality Guaranteed

Any Deadline

No Plagiarism