AcpServerConnectionState class final

Internal state for one remotely transported ACP connection.

Incoming HTTP/WebSocket messages are serialized into inbound. Messages produced by the connected application are routed to connection and session hubs while allOutbound retains original batch framing.

Constructors

AcpServerConnectionState({required String connectionId, required AcpWritable<Object?> inbound, required Stream<Object?> outbound, int outboundCapacity = 1024, int maximumSessions = 10000, int maximumPendingRoutes = 4096, bool allowBatches = false, AcpOutboundOverflowHandler? onOverflow})
Creates and starts a server connection state.

Properties

allOutbound AcpOutboundHub<Object?>
Original frames emitted by the application.
final
closed Future<void>
Completes after every owned transport/hub has settled.
no setter
closeReason Object?
Reason supplied to close, when any.
no setter
connectionId String
Opaque routing identifier. This is not an authentication credential.
final
connectionOutbound AcpOutboundHub<Object?>
Connection-scoped individual messages.
final
hashCode int
The hash code for this object.
no setterinherited
isClosed bool
Whether the state has closed.
no setter
maximumPendingRoutes int
Maximum request/response routes retained while calls are pending.
final
maximumSessions int
Maximum session routes retained by this connection.
final
outboundCapacity int
Maximum values retained by each outbound hub.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionCount int
Number of active session routes.
no setter

Methods

cancelResponseWaiter(JsonRpcId id, [Object? reason]) bool
Cancels a response waiter registered by receiveResponse.
close([Object? reason]) Future<void>
Closes the state and all owned resources. Repeated calls are harmless.
enableBatches() → void
Enables JSON-RPC batch frames after protocol-v2 negotiation.
ensureSession(String sessionId) AcpOutboundHub<Object?>
Returns the interned hub for sessionId.
expectedClientResponseRoute(JsonRpcId id) AcpServerRoute?
Returns the expected route for a response to an agent request.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
receiveResponse(JsonRpcId id) Future<Object?>
Waits for and consumes one outbound response with id.
session(String sessionId) AcpOutboundHub<Object?>?
Looks up a session hub without creating it.
toString() String
A string representation of this object.
override
writeInbound(Object? frame, {AcpServerRoute route = const AcpConnectionRoute(), bool inferSessionRoute = true, bool validateClientResponseRoute = true}) Future<void>
Serializes one incoming transport frame into the application.

Operators

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