MockSocketServer constructor
MockSocketServer({
- required MockPayloadBuilder build,
- Duration tick = const Duration(seconds: 1),
- bool ackOps = true,
- String opField = 'op',
- String channelField = 'channel',
- String dataField = 'data',
- String argsField = 'args',
- String errorField = 'error',
- String subscribeOp = 'subscribe',
- 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',
});