<!--
{
  "availability" : [
    "iOS: 2.0.0 - 27.0.0",
    "iPadOS: 2.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.2.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NetService/resolve(withTimeout:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSNetService(im)resolveWithTimeout:"
  },
  "title" : "resolve(withTimeout:)"
}
-->

# resolve(withTimeout:)

Starts a resolve process of a finite duration for the service.

```
func resolve(withTimeout timeout: TimeInterval)
```

## Parameters

`timeout`

The maximum number of seconds to attempt a resolve. A value of 0.0 indicates no timeout and a resolve process of indefinite duration.

## Discussion

During the resolve period, the service sends [`netServiceDidResolveAddress(_:)`](/documentation/Foundation/NetServiceDelegate/netServiceDidResolveAddress(_:)) to the delegate for each address it discovers that matches the service parameters. Once the timeout is hit, the service sends [`netServiceDidStop(_:)`](/documentation/Foundation/NetServiceDelegate/netServiceDidStop(_:)) to the delegate. If no addresses resolve during the timeout period, the service sends [`netService(_:didNotResolve:)`](/documentation/Foundation/NetServiceDelegate/netService(_:didNotResolve:)) to the delegate.

## See Also

[`addresses`](/documentation/Foundation/NetService/addresses)

A read-only array containing `NSData` objects, each of which contains a socket address for the service.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)