MockSocketServer constructor

MockSocketServer({
  1. required MockPayloadBuilder build,
  2. Duration tick = const Duration(seconds: 1),
  3. bool ackOps = true,
  4. String opField = 'op',
  5. String channelField = 'channel',
  6. String dataField = 'data',
  7. String argsField = 'args',
  8. String errorField = 'error',
  9. String subscribeOp = 'subscribe',
  10. String unsubscribeOp = 'unsubscribe',
})

Creates a mock server that answers with build every tick.

With ackOps on, every {"op": …} frame is answered with a matching success control frame, so a codec whose handshake waits for a login reply gets one.

Implementation

MockSocketServer({
  required this.build,
  this.tick = const Duration(seconds: 1),
  this.ackOps = true,
  this.opField = 'op',
  this.channelField = 'channel',
  this.dataField = 'data',
  this.argsField = 'args',
  this.errorField = 'error',
  this.subscribeOp = 'subscribe',
  this.unsubscribeOp = 'unsubscribe',
});