dial method
Dials a peer at the given multiaddress with optional timeout override Returns a connection to the peer if successful
Implementation
@override
Future<TransportConn> dial(MultiAddr addr, {Duration? timeout}) async {
_logger.fine('[UDXTransport.dial] Attempting to dial $addr with timeout: ${timeout ?? config.dialTimeout}');
final host = addr.valueForProtocol('ip4') ?? addr.valueForProtocol('ip6');
final port = int.parse(addr.valueForProtocol('udp') ?? '0');
if (host == null || port == 0) {
throw ArgumentError('Invalid UDX multiaddr for dialing: $addr');
}
final effectiveTimeout = timeout ?? config.dialTimeout;
// Use UDX exception handler with retry logic for the entire dial operation
return await UDXExceptionHandler.handleUDXOperation(
() => _performDial(addr, host, port, effectiveTimeout),
'UDXTransport.dial($addr)',
retryConfig: UDXRetryConfig.regular,
);
}