InMemoryTransport class final Testing

A transport that connects to an in-process server, for tests.

Every successful connect creates a connected pair: the client side is returned and the server side is passed to onConnect. FakeIndiServer builds on this to simulate INDI devices.

Implemented types

Constructors

InMemoryTransport({required void onConnect(InMemoryConnection serverSide)})
Creates a transport that hands the server side of each new connection to onConnect.

Properties

connectAttempts → int
The number of connection attempts made so far, including refused ones.
no setter
connectDelay ↔ Duration
An artificial delay before connect completes.
getter/setter pair
description → String
A short description of the endpoint for logs, such as tcp://localhost:7624.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
onConnect → void Function(InMemoryConnection serverSide)
Called with the server side of each new connection.
final
refuseConnections ↔ bool
When true, connect fails as if the server were unreachable.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

connect({Duration? timeout}) → Future<IndiConnection>
Opens a new connection.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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