TcpTransport class

Transport that communicates with the Copilot CLI server over TCP.

Connects to a running CLI server at the specified host:port and communicates via Content-Length framed JSON-RPC messages.

Implemented types

Constructors

TcpTransport({required String host, required int port, Duration connectionTimeout = const Duration(seconds: 10)})
Creates a TCP transport that connects to host:port.

Properties

connectionTimeout Duration
Maximum time to wait when establishing the TCP connection.
final
hashCode int
The hash code for this object.
no setterinherited
host String
The hostname or IP address of the Copilot CLI server.
final
isOpen bool
Whether the transport is currently connected/open.
no setteroverride
messages Stream<Map<String, dynamic>>
Stream of incoming JSON-RPC messages (already decoded from JSON).
no setteroverride
port int
The TCP port of the Copilot CLI server.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Closes the transport and releases resources.
override
connect() Future<void>
Connects to the TCP server.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(Map<String, dynamic> message) Future<void>
Sends a JSON-RPC message (will be encoded to JSON by the transport).
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited