Spec-Zone.ru › Dart 2

dart:io

Метод startConnect

Future<ConnectionTask<Socket>> startConnect(
  1. dynamic host,
  2. int port,
  3. {dynamic sourceAddress,
  4. int sourcePort = 0}
)

Как и connect, но возвращает Future, который завершается объектом ConnectionTask, который можно отменить, если Socket больше не нужен.

Реализация

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

© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-io/Socket/startConnect.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API