Question: Can I get help with this java assignment, I'm stuck and not sure what to do next. I provided my code CHAT SERVER import ocsf.server.AbstractServer;
Can I get help with this java assignment, I'm stuck and not sure what to do next. I provided my code


CHAT SERVER
import ocsf.server.AbstractServer;
import ocsf.server.ConnectionToClient;
public class ChatServer extends AbstractServer
{
public ChatServer()
{
super(12345);
}
public void handleMessageFromClient(Object arg0, ConnectionToClient arg1)
{
}
public void listeningException(Throwable exception)
{
}
public void serverStarted()
{
}
}
TEST CHAT SERVER
public class TestChatServer
{
}
Implement a Java Class named Ghat ecoeK (Chat Senec must extend Abstract Seae that "Implement abstract methods" is selected when creating the ChatServer class. Make sure The method description for ChatServer is given below: public ChatServer) Constructor for the ChatServer. The port data field should be set to 12345. The timeout data field should be set to 500ms. public void Slot method that is invoked whenever the client sends a message to the server. For now, the method can simply display on the Console "Client Message sent to Server" bject arge, SennestigntoClient arg1) public void listeningException Throwable exception) Hook method that is invoked whenever an exception occurs while the Server is listening for clients to connect. For now display the following messages to the Console: 1. 2. 3. Display a message "Listening Exception Occurred" The actual message set by the system within the exception input parameter The stack trace associated with the exception input parameter public void secverStarted.) Hook method that is invoked once the Server is successfully listening for Clients to connect. For now, display the following message to the Console: "Server Started" Implement a second class named TestChatServer, The TestChatServer class should declare the following private Shatsecvec server And implement only the following 2 methods: public Jestchatserverint port, int timeout) Constructor. Accepts two input parameters- the port and the timeout. This Constructor should perform the following steps: 1. Instantiate a ChatServer object using the default Constructor. 2. Set the port data field of the ChatServer object to the value of the input parameter port. 3. Set the timeout data field of the ChatServer object to the value of the input parameter timeout. 4. Invoke the listen method on the ChatServer object public static void nain(String[] args) Accepts 2 command line arguments stored in acgs input parameter: acesLe] -> port # for the ChatServer args1] - timeout value for the ChatServer These 2 values must be passed into the ChatServer Constructor Test your program using a Web Browser Since we don't have a Java Client implemented yet, perform the following steps to test this version of your ChatServer Start your ChatSewe, with a port # and a timeout value (port # and timeout are provided from the Command Line) Open the Web Browser of your choice Type the following in the address bar of your Web Browser: 1. 2. 3. 127.0.0.1:port no Note: Aor.aeis the port # you started your 4. A listening Exception will be thrown by the ChatServer because the Web Browser is not a Java Client
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
