Class InputWorker

java.lang.Object
com.example.common.input.InputWorker

public class InputWorker extends Object
The InputWorker class is responsible for handling user input for various network related parameters.
  • Constructor Details

    • InputWorker

      public InputWorker(StreamIO streamIO, TransportFactory transportFactory)
      Constructor for InputWorker class.
      Parameters:
      streamIO - The streamIO object for input/output operations.
      transportFactory - The transportFactory object for creating network transports.
  • Method Details

    • getPortServer

      public int getPortServer()
      Method to get the port number for the input server.
      Returns:
      The port number for the input server.
    • getIpServer

      public String getIpServer()
      Method to get the IP address of the server.
      Returns:
      The IP address of the server.
    • getPortToServer

      public int getPortToServer()
      Method to initialize the port that connects to the server
      Returns:
      number of port for connection to server
    • getPortClient

      public int getPortClient()
      Method to initialize the port for incoming messages
      Returns:
      number of port
    • getNickName

      public String getNickName(String welcomeMessage)
      Method to get the nickname of the user.
      Parameters:
      welcomeMessage - The welcome message prompting the user to enter their nickname.
      Returns:
      The nickname entered by the user.