GCKNetworkAddress Class
Stay organized with collections
Save and categorize content based on your preferences.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["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."]]],[]]