GCKNetworkAddress Class

GCKNetworkAddress Class Reference

Overview

An object that represents a network IP address.

This object is immutable.

Since
4.2

Inherits NSObject, <NSCopying>, and <NSSecureCoding>.

Instance Method Summary

(instancetype) 
- init
Using the default initializer is not allowed. More...
(instancetype) 
Constructs a GCKNetworkAddress with the given address type and IP address. More...
(instancetype) 
Constructs a GCKNetworkAddress with the given address type and raw address. More...

Class Method Summary

Constructs a wildcard address of the given type. More...
Constructs a loopback address of the given type. More...
Constructs an IPv4 broadcast address. More...
Constructs an IPv4 address. More...
Constructs an IPv6 address. More...
Constructs an IPC address. More...

Property Summary

GCKNetworkAddressType 
The address type. More...
NSString * 
The IP address. More...
NSData * 
The network address as an NSData containing the appropriate address structure (e.g., struct in_addr or struct in6_addr). More...

Method Detail

- (instancetype) init

Using the default initializer is not allowed.

- (instancetype) initWithType: (GCKNetworkAddressType)  type
ipAddress: (nullable NSString *)  ipAddress

Constructs a GCKNetworkAddress with the given address type and IP address.

Parameters
type The address type.
ipAddress The IP address, in textual form. May be nil to indicate the wildcard ("any") address.
- (instancetype) initWithType: (GCKNetworkAddressType)  type
addressData: (nullable NSData *)  addressData

Constructs a GCKNetworkAddress with the given address type and raw address.

Parameters
type The address type.
addressData An NSData object containing the appropriate address structure (e.g., struct in_addr or struct in6_addr). For the GCKNNetworkAddressTypeIPC, the data is expected to be a UTF8 encoding.
+ ( GCKNetworkAddress *) wildcardAddressOfType: (GCKNetworkAddressType)  type

Constructs a wildcard address of the given type.

+ ( GCKNetworkAddress *) loopbackAddressOfType: (GCKNetworkAddressType)  type

Constructs a loopback address of the given type.

+ ( GCKNetworkAddress *) IPv4BroadcastAddress

Constructs an IPv4 broadcast address.

+ ( GCKNetworkAddress *) addressWithIPv4Address: (NSString *)  ipAddress

Constructs an IPv4 address.

+ ( GCKNetworkAddress *) addressWithIPv6Address: (NSString *)  ipAddress

Constructs an IPv6 address.

+ ( GCKNetworkAddress *) addressWithIPCPath: (NSString *)  path

Constructs an IPC address.

Property Detail

- (GCKNetworkAddressType) type
read nonatomic assign

The address type.

- (NSString*) ipAddress
read nonatomic copy

The IP address.

- (NSData*) addressData
read nonatomic copy

The network address as an NSData containing the appropriate address structure (e.g., struct in_addr or struct in6_addr).

For the address type IPC, this field is a UTF8 encoding.

Create a Mobile Website
View Site in Mobile | Classic
Share by: