Network Type Transition Optimization
Nucleic-Session: 40F8C53A-F001-423A-8607-EAE181DBE14B Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -180,7 +180,11 @@ final class HostConnection {
|
|||||||
relay: (membershipToken: String?, url: String?)? = nil
|
relay: (membershipToken: String?, url: String?)? = nil
|
||||||
) -> [TransportAttempt] {
|
) -> [TransportAttempt] {
|
||||||
var candidates: [TransportAttempt] = []
|
var candidates: [TransportAttempt] = []
|
||||||
if let endpoint = discovery.endpoint(forFingerprint: fingerprint, lanHost: lanHost, lanPort: lanPort) {
|
// Only offer LAN when the device actually has a LAN-capable path (Wi-Fi/wired). On cellular
|
||||||
|
// the pinned `lanHost:lanPort` is unreachable, so including it here would just burn the
|
||||||
|
// connect timeout before falling through — skip it and dial tailnet/relay immediately.
|
||||||
|
if pathMonitor.canUseLAN,
|
||||||
|
let endpoint = discovery.endpoint(forFingerprint: fingerprint, lanHost: lanHost, lanPort: lanPort) {
|
||||||
candidates.append(.lan(endpoint))
|
candidates.append(.lan(endpoint))
|
||||||
}
|
}
|
||||||
if let tailnet, let host = tailnet.host, let port = tailnet.port, TailnetSupport.isBuiltIn {
|
if let tailnet, let host = tailnet.host, let port = tailnet.port, TailnetSupport.isBuiltIn {
|
||||||
|
|||||||
Reference in New Issue
Block a user