SocketAdaptor constructor
SocketAdaptor(
- SocketInterface impl, {
- InternetAddress address,
- InternetAddress remoteAddress,
- int port,
- int remotePort,
- StringCallback debugPrint,
Implementation
SocketAdaptor(this.impl,
{this.address,
this.remoteAddress,
this.port,
this.remotePort,
this.debugPrint}) {
controller = StreamController<Uint8List>(sync: true);
consumer = SocketAdaptorStreamConsumer(this);
sink = IOSink(consumer);
/// https://github.com/dart-lang/sdk/issues/39589
impl.listen((Uint8List m) => controller.add(Uint8List.fromList(m)));
impl.handleError((error) => controller.addError(error));
impl.handleDone((String reason) => controller.addError(reason));
}