start method

Future start({
  1. bool ipv4 = true,
  2. bool ipv6 = true,
  3. dynamic onError(
    1. Exception
    ) = _doNowt,
  4. int port = 1900,
})

defaults to port 1900 to be able to receive broadcast notifications and not just M-SEARCH replies.

Implementation

Future start({
  bool ipv4 = true,
  bool ipv6 = true,
  Function(Exception) onError = _doNowt,
  int port = 1900,
}) async {
  _interfaces = await NetworkInterface.list();

  if (ipv4) {
    await _createSocket(InternetAddress.anyIPv4, port, onError: onError);
  }

  if (ipv6) {
    await _createSocket(InternetAddress.anyIPv6, port, onError: onError);
  }
}