---
title: DNSServiceBrowseReply
framework: dnssd
role: symbol
role_heading: Type Alias
path: dnssd/dnsservicebrowsereply
---

# DNSServiceBrowseReply

Callback for handling the results of previous calls to DNSServiceBrowse.

## Declaration

```swift
typealias DNSServiceBrowseReply = (DNSServiceRef?, DNSServiceFlags, UInt32, DNSServiceErrorType, UnsafePointer<CChar>?, UnsafePointer<CChar>?, UnsafePointer<CChar>?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

- `sdRef`: The DNSServiceRef initialized by doc://com.apple.dnssd/documentation/dnssd/DNSServiceBrowse(_:_:_:_:_:_:_:).
- `flags`: Possible values are doc://com.apple.dnssd/documentation/dnssd/kDNSServiceFlagsMoreComing and kDNSServiceFlagsAdd. See flag definitions for details.
- `interfaceIndex`: The interface on which the service is advertised. This index should be passed to doc://com.apple.dnssd/documentation/dnssd/DNSServiceResolve(_:_:_:_:_:_:_:_:) when resolving the service.
- `errorCode`: Will be doc://com.apple.dnssd/documentation/dnssd/kDNSServiceErr_NoError (0) on success, otherwise will indicate the failure that occurred. Other parameters are undefined if the errorCode is nonzero.
- `serviceName`: The discovered service name. This name should be displayed to the user, and stored for subsequent use in the doc://com.apple.dnssd/documentation/dnssd/DNSServiceResolve(_:_:_:_:_:_:_:_:) call.
- `regtype`: The service type, which is usually (but not always) the same as was passed to doc://com.apple.dnssd/documentation/dnssd/DNSServiceBrowse(_:_:_:_:_:_:_:). One case where the discovered service type may not be the same as the requested service type is when using subtypes: The client may want to browse for only those ftp servers that allow anonymous connections. The client will pass the string “_ftp._tcp,_anon” to doc://com.apple.dnssd/documentation/dnssd/DNSServiceBrowse(_:_:_:_:_:_:_:), but the type of the service that’s discovered is simply “_ftp._tcp”. The regtype for each discovered service instance should be stored along with the name, so that it can be passed to doc://com.apple.dnssd/documentation/dnssd/DNSServiceResolve(_:_:_:_:_:_:_:_:) when the service is later resolved.
- `replyDomain`: The domain of the discovered service instance. This may or may not be the same as the domain that was passed to doc://com.apple.dnssd/documentation/dnssd/DNSServiceBrowse(_:_:_:_:_:_:_:). The domain for each discovered service instance should be stored along with the name, so that it can be passed to doc://com.apple.dnssd/documentation/dnssd/DNSServiceResolve(_:_:_:_:_:_:_:_:) when the service is later resolved.
- `context`: The context pointer that was passed to the callout.

## See Also

### Callbacks

- [DNSServiceGetAddrInfoReply](dnssd/dnsservicegetaddrinforeply.md)
- [DNSServiceRegisterRecordReply](dnssd/dnsserviceregisterrecordreply.md)
- [DNSServiceRegisterReply](dnssd/dnsserviceregisterreply.md)
- [DNSServiceResolveReply](dnssd/dnsserviceresolvereply.md)
- [DNSServiceQueryRecordReply](dnssd/dnsservicequeryrecordreply.md)
- [DNSServiceNATPortMappingReply](dnssd/dnsservicenatportmappingreply.md)
- [DNSServiceDomainEnumReply](dnssd/dnsservicedomainenumreply.md)
