VMServiceClient class

A client for the Dart VM service protocol.

Connect to a VM service endpoint using connect, and use getVM to load information about the VM itself.

The client supports VM service versions 1.x (which first shipped with Dart 1.11), 2.x (which first shipped with Dart 1.12), and 3.x (which first shipped with Dart 1.13). Some functionality may be unavailable in older VM service versions; those places will be clearly documented. You can check the version of the VM service you're connected to using getVersion.

Because it takes an extra RPC call to verify compatibility with the protocol version, the client doesn't do so by default. Users who want to be sure they're talking to a supported protocol version can call validateVersion.

Constructors

VMServiceClient(StreamChannel<String> channel)
Creates a client that reads incoming messages from a channel which contains JSON-encoded String instances. [...]
factory
VMServiceClient.connect(dynamic url)
Connects to the VM service protocol at url. [...]
factory
VMServiceClient.withoutJson(StreamChannel channel)
Creates a client that reads incoming messages from a channel which contains decoded JSON maps and lists. [...]
factory

Properties

done → Future
A future that fires when the underlying connection has been closed. [...]
final
onIsolateRunnable → Stream<VMIsolateRef>
A broadcast stream that emits every isolate as it becomes runnable. [...]
read-only
onIsolateStart → Stream<VMIsolateRef>
A broadcast stream that emits every isolate as it starts.
read-only
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

close() → Future
Closes the underlying connection to the VM service. [...]
getFlags() → Future<List<VMFlag>>
Returns a list of flags that were passed to the VM. [...]
getVersion() → Future<VMServiceVersion>
Returns the version of the VM service protocol that this client is communicating with. [...]
getVM() → Future<VM>
Returns information about the Dart VM.
validateVersion({Duration timeout: const Duration(seconds: 2) }) → Future
Checks the VM service protocol version and throws a VMUnsupportedVersionException if it's not a supported version. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

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