Question: Hi can somone help me debug this code. This is the client side code I created a UDP client/server chat room for multiple users. The

Hi can somone help me debug this code. This is the client side code I created a UDP client/server chat room for multiple users. The declaring the "serverConnection" as "serverConn" is giving me a problem. import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.*; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; public class ChatClient { private static final int SERVER_PORT = 9090; private static final String SERVER_IP = "127.0.0.1"; // ip of self computer private static BufferedReader input; //temp public static void main(String[] args) throws IOException { Socket socket = new Socket(SERVER_IP, SERVER_PORT); //creating Socket with the ip of server and port ** serverConnection serverConn = new serverConnection(socket); //having issue declaring this BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); PrintWriter output = new PrintWriter(socket.getOutputStream(), true); ** new Thread(serverConn).start(); // also geting a error here while (true) { System.out.println(">"); String command = keyboard.readLine(); if (command.equals("quit")) break; // if user inputs quit it will end program output.println(command); } socket.close(); System.exit(0); } }

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 Accounting Questions!