socketConnect 方法

Future<Socket> socketConnect(
  1. dynamic host,
  2. int port, {
  3. dynamic sourceAddress,
  4. int sourcePort = 0,
  5. Duration? timeout,
})

异步返回一个连接到指定主机和端口的 Socket

当此覆盖安装时,此函数将覆盖 Socket.connect(...) 的行为。

实现

Future<Socket> socketConnect(host, int port,
    {sourceAddress, int sourcePort = 0, Duration? timeout}) {
  return Socket._connect(host, port,
      sourceAddress: sourceAddress, sourcePort: sourcePort, timeout: timeout);
}