Class TcpRuntimeConnection
java.lang.Object
com.github.copilot.rpc.RuntimeConnection
com.github.copilot.rpc.TcpRuntimeConnection
Spawns a runtime child process listening on a TCP socket and connects to it.
Construct with
RuntimeConnection.forTcp().- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptiongetArgs()Returns the extra command-line arguments passed to the runtime process.Returns the shared secret the SDK sends to the spawned runtime to authenticate the TCP connection.getPath()Returns the path to the runtime executable.intgetPort()Returns the TCP port the spawned runtime listens on.Sets extra command-line arguments passed to the runtime process.setConnectionToken(String connectionToken) Sets the shared secret the SDK sends to the spawned runtime to authenticate the TCP connection.Sets the path to the runtime executable.setPort(int port) Sets the TCP port the spawned runtime listens on.Methods inherited from class RuntimeConnection
forInProcess, forStdio, forStdio, forTcp, forUri
-
Method Details
-
getPath
Returns the path to the runtime executable.- Returns:
- the path, or
nullto use the runtime discovered on thePATH
-
setPath
Sets the path to the runtime executable.- Parameters:
path- the path, ornullto use the runtime discovered on thePATH- Returns:
- this instance for method chaining
-
getPort
public int getPort()Returns the TCP port the spawned runtime listens on.- Returns:
- the port, or
0to auto-allocate a free port
-
setPort
Sets the TCP port the spawned runtime listens on.- Parameters:
port- the port, or0(the default) to auto-allocate a free port- Returns:
- this instance for method chaining
-
getConnectionToken
Returns the shared secret the SDK sends to the spawned runtime to authenticate the TCP connection.- Returns:
- the token, or
nullto generate one automatically
-
setConnectionToken
Sets the shared secret the SDK sends to the spawned runtime to authenticate the TCP connection.- Parameters:
connectionToken- the token, ornullto generate one automatically- Returns:
- this instance for method chaining
-
getArgs
-
setArgs
Sets extra command-line arguments passed to the runtime process.- Parameters:
args- the arguments, ornullfor none- Returns:
- this instance for method chaining
-