Package com.example.common.input
Class InputWorker
java.lang.Object
com.example.common.input.InputWorker
The InputWorker class is responsible for handling user input for various network related parameters.
-
Constructor Summary
ConstructorsConstructorDescriptionInputWorker
(StreamIO streamIO, TransportFactory transportFactory) Constructor for InputWorker class. -
Method Summary
Modifier and TypeMethodDescriptionMethod to get the IP address of the server.getNickName
(String welcomeMessage) Method to get the nickname of the user.int
Method to initialize the port for incoming messagesint
Method to get the port number for the input server.int
Method to initialize the port that connects to the server
-
Constructor Details
-
InputWorker
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
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
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.
-