DekGenius.com
[ Team LiB ] Previous Section Next Section

NSHost Mac OS X 10.0

This class is used to perform host name lookup and IP address translation. Translations are provided by any services available to the operating system such as NetInfo, LDAP, or DNS. Instances of NSHost are created using one of three class methods: currentHost, hostWithAddress:, and hostWithName:. The first, currentHost, returns an NSHost object that contains information about the host running the application process. The methods hostWithName: and hostWithAddress: create NSHost objects for the host with the specified name or address. The name used in hostWithName: can be a simple host name, or it can be a fully qualified domain name. When creating a host object with hostWithAddress:, the IP address is specified as a string in dotted decimal format, such as 192.168.254.198. Once an instance of NSHost has been created, it can be queried for the IP addresses and names that the host identifies with.

figs/cocn_1343.gif

@interface NSHost : NSObject
 // Convenience Constructors
   + (NSHost *)hostWithAddress:(NSString *)address;
   + (NSHost *)hostWithName:(NSString *)name;
 // Class Methods
   + (NSHost *)currentHost;
   + (void)flushHostCache;
   + (BOOL)isHostCacheEnabled;
   + (void)setHostCacheEnabled:(BOOL)flag;
 // Instance Methods
   - (NSString *)address;
   - (NSArray *)addresses;
   - (BOOL)isEqualToHost:(NSHost *)aHost;
   - (NSString *)name;
   - (NSArray *)names;

    [ Team LiB ] Previous Section Next Section