jens@28: // jens@28: // MYAddressLookup.h jens@28: // MYNetwork jens@28: // jens@28: // Created by Jens Alfke on 4/24/09. jens@28: // Copyright 2009 Jens Alfke. All rights reserved. jens@28: // jens@28: jens@28: #import "MYDNSService.h" jens@28: jens@28: jens@28: /** An asynchronous DNS address lookup. Supports both Bonjour services and traditional hostnames. */ jens@28: @interface MYAddressLookup : MYDNSService jens@28: { jens@28: NSString *_hostname; jens@28: UInt16 _interfaceIndex; jens@28: NSMutableSet *_addresses; jens@28: UInt16 _port; jens@28: CFAbsoluteTime _expires; jens@28: } jens@28: jens@28: /** Initializes the lookup with a DNS hostname. */ jens@28: - (id) initWithHostname: (NSString*)hostname; jens@28: jens@28: /** The port number; this will be copied into the resulting IPAddress objects. jens@28: Defaults to zero, but you can set it before calling -start. */ jens@28: @property UInt16 port; jens@28: jens@28: /** The index of the network interface. You usually don't need to set this. */ jens@28: @property UInt16 interfaceIndex; jens@28: jens@28: /** The resulting address(es) of the host, as HostAddress objects. */ jens@28: @property (readonly) NSSet *addresses; jens@28: jens@28: /** How much longer the addresses will remain valid. jens@28: If the value is zero, the addresses are no longer valid, and you should instead jens@28: call -start again and wait for the 'addresses' property to update. jens@28: If you set the service to continuous mode, addresses will never expire since the jens@28: query will continue to update them. */ jens@28: @property (readonly) NSTimeInterval timeToLive; jens@28: jens@28: @end