W3cubDocs

/Dart 2

startConnect method

Future<ConnectionTask<Socket>> startConnect (dynamic host, int port, { dynamic sourceAddress })

Like connect, but returns a Future that completes with a ConnectionTask that can be cancelled if the Socket is no longer needed.

Implementation

static Future<ConnectionTask<Socket>> startConnect(host, int port,
    {sourceAddress}) {
  final IOOverrides overrides = IOOverrides.current;
  if (overrides == null) {
    return Socket._startConnect(host, port, sourceAddress: sourceAddress);
  }
  return overrides.socketStartConnect(host, port,
      sourceAddress: sourceAddress);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-io/Socket/startConnect.html