canDial method

  1. @override
bool canDial(
  1. MultiAddr addr
)
override

Returns true if this transport can dial the given multiaddress

Implementation

@override
bool canDial(MultiAddr addr) {
  // Check if the address has either ip4 or ip6 and tcp protocols
  final hasIP = addr.hasProtocol('ip4') || addr.hasProtocol('ip6');
  final hasTCP = addr.hasProtocol('tcp');
  return hasIP && hasTCP;
}