Class TcpClientOutput

java.lang.Object
org.jacoco.agent.rt.internal.output.TcpClientOutput
All Implemented Interfaces:
IAgentOutput

public class TcpClientOutput extends Object implements IAgentOutput
Output that connects to a TCP port. This controller uses the following agent options:
  • address
  • port
  • Field Details

  • Constructor Details

    • TcpClientOutput

      public TcpClientOutput(IExceptionLogger logger)
      New controller instance.
      Parameters:
      logger - logger to use in case of exceptions is spawned threads
  • Method Details

    • startup

      public void startup(AgentOptions options, RuntimeData data) throws IOException
      Description copied from interface: IAgentOutput
      Configure the agent controller with the supplied options and connect it to the coverage runtime
      Specified by:
      startup in interface IAgentOutput
      Parameters:
      options - Options used to configure the agent controller
      data - Execution data for this agent
      Throws:
      IOException
    • shutdown

      public void shutdown() throws Exception
      Description copied from interface: IAgentOutput
      Shutdown the agent controller and clean up any resources it has created.
      Specified by:
      shutdown in interface IAgentOutput
      Throws:
      Exception - in case shutdown fails
    • writeExecutionData

      public void writeExecutionData(boolean reset) throws IOException
      Description copied from interface: IAgentOutput
      Write all execution data in the runtime to a location determined by the agent controller. This method should only be called by the Agent
      Specified by:
      writeExecutionData in interface IAgentOutput
      Parameters:
      reset - if true execution data is cleared afterwards
      Throws:
      IOException - in case writing fails
    • createSocket

      protected Socket createSocket(AgentOptions options) throws IOException
      Open a socket based on the given configuration.
      Parameters:
      options - address and port configuration
      Returns:
      opened socket
      Throws:
      IOException