FakeTransport constructor

FakeTransport({
  1. bool autoReady = true,
  2. void onSend(
    1. Object frame
    )?,
})

Creates a fake transport.

With autoReady false, ready stays pending until completeReady or failReady is called, which is how a slow or refused connection is tested. onSend sees every frame as it is sent, which is how MockSocketServer answers them.

Implementation

FakeTransport({bool autoReady = true, this.onSend}) {
  if (autoReady) _ready.complete();
}