Class TcpRuntimeConnection

java.lang.Object
com.github.copilot.rpc.RuntimeConnection
com.github.copilot.rpc.TcpRuntimeConnection

@CopilotExperimental public final class TcpRuntimeConnection extends RuntimeConnection
Spawns a runtime child process listening on a TCP socket and connects to it. Construct with RuntimeConnection.forTcp().
Since:
1.0.0
  • Method Details

    • getPath

      public String getPath()
      Returns the path to the runtime executable.
      Returns:
      the path, or null to use the runtime discovered on the PATH
    • setPath

      public TcpRuntimeConnection setPath(String path)
      Sets the path to the runtime executable.
      Parameters:
      path - the path, or null to use the runtime discovered on the PATH
      Returns:
      this instance for method chaining
    • getPort

      public int getPort()
      Returns the TCP port the spawned runtime listens on.
      Returns:
      the port, or 0 to auto-allocate a free port
    • setPort

      public TcpRuntimeConnection setPort(int port)
      Sets the TCP port the spawned runtime listens on.
      Parameters:
      port - the port, or 0 (the default) to auto-allocate a free port
      Returns:
      this instance for method chaining
    • getConnectionToken

      public String getConnectionToken()
      Returns the shared secret the SDK sends to the spawned runtime to authenticate the TCP connection.
      Returns:
      the token, or null to generate one automatically
    • setConnectionToken

      public TcpRuntimeConnection setConnectionToken(String connectionToken)
      Sets the shared secret the SDK sends to the spawned runtime to authenticate the TCP connection.
      Parameters:
      connectionToken - the token, or null to generate one automatically
      Returns:
      this instance for method chaining
    • getArgs

      public List<String> getArgs()
      Returns the extra command-line arguments passed to the runtime process.
      Returns:
      the arguments, or null if none are configured
    • setArgs

      public TcpRuntimeConnection setArgs(List<String> args)
      Sets extra command-line arguments passed to the runtime process.
      Parameters:
      args - the arguments, or null for none
      Returns:
      this instance for method chaining