GCKNetworkAddress Class
An object that represents a network IP address.
This object is immutable.
- Since
- 4.2
Inherits NSObject, <NSCopying>, and <NSSecureCoding>.
|
GCKNetworkAddressType | type |
| The address type. More...
|
|
NSString * | ipAddress |
| The IP address. More...
|
|
NSData * | addressData |
| The network address as an NSData containing the appropriate address structure (e.g., struct in_addr or struct in6_addr). More...
|
|
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. |
Constructs a wildcard address of the given type.
Constructs a loopback address of the given type.
Constructs an IPv4 broadcast address.
Constructs an IPv4 address.
Constructs an IPv6 address.
Constructs an IPC address.
- (GCKNetworkAddressType) type |
|
readnonatomicassign |
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `GCKNetworkAddress` class represents a network IP address and is immutable."],["It provides methods to construct network addresses of various types, including IPv4, IPv6, and IPC."],["You can obtain the address type, IP address string, and raw address data from instances of this class."],["The default initializer is not allowed; you must use designated initializers to create instances."]]],["The `GCKNetworkAddress` class represents an immutable network IP address. Key actions include: constructing addresses with specified type and IP/raw address using `initWithType:ipAddress:` or `initWithType:addressData:`, creating wildcard addresses with `wildcardAddressOfType:`, loopback addresses with `loopbackAddressOfType:`, or IPv4/IPv6/IPC addresses with corresponding methods. It has properties that return the address's type, IP address, and network data representation. The default initializer is not allowed.\n"]]