Class TCPClientManager

java.lang.Object
com.inesm.KeyManager.services.TCPClientManager
All Implemented Interfaces:
Runnable

@Service public class TCPClientManager extends Object implements Runnable
Provides a TCP Client.
  • Constructor Details

    • TCPClientManager

      public TCPClientManager(CommunicationService comService)
      Constructor method for TCPClientManager.
      Parameters:
      comService - the communication service that will supply the resources to be sent over the network.
  • Method Details

    • setup

      public void setup(String ip) throws IOException
      Sets up a TCP connection.

      Will use the port defined in the application.properties file.

      Parameters:
      ip - the ip address of the target machine.
      Throws:
      IOException - if an error occurred setting up the connection
    • stop

      public void stop() throws IOException
      Closes a socket connection and output stream.
      Throws:
      IOException - if an error occurred during closing
    • run

      public void run()
      Specified by:
      run in interface Runnable