bind static method

Future<TFtpClient> bind(
  1. String host,
  2. int port, {
  3. int blockSize = 512,
})

Bind client to host and port

Implementation

static Future<TFtpClient> bind(String host, int port, {int blockSize = 512}) {
  Completer<TFtpClient> completer = Completer();
  RawDatagramSocket.bind(host, port).then((socket) {
    var client = TFtpClient(host, port, blockSize: blockSize);
    client._socket = socket;
    client._stream = socket.asBroadcastStream();
    completer.complete(client);
  });
  return completer.future;
}