Lớp GCKNetworkAddress
Một đối tượng đại diện cho địa chỉ IP mạng.
Đối tượng này là bất biến.
- Năm thành lập
- 4,2
Kế thừa NSObject, <NSCopying> và <NSSecureCoding>.
Không được phép sử dụng trình khởi chạy mặc định.
- (instancetype) initWithType: |
|
(GCKNetworkAddressType) |
type |
ipAddress: |
|
(nullable NSString *) |
ipAddress |
|
|
| |
Tạo GCKNetworkAddress có loại địa chỉ và địa chỉ IP đã cho.
- 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 |
|
|
| |
Tạo GCKNetworkAddress có loại địa chỉ và địa chỉ thô đã cho.
- 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. |
Tạo địa chỉ ký tự đại diện của loại đã cho.
Tạo địa chỉ lặp lại của loại đã cho.
Tạo địa chỉ truyền tin IPv4.
- (GCKNetworkAddressType) type |
|
readnonatomicassign |
Địa chỉ mạng dưới dạng NSData chứa cấu trúc địa chỉ phù hợp (ví dụ: struct in_addr hoặc struct in6_addr).
Đối với loại địa chỉ IPC, trường này được mã hoá UTF8.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2023-12-02 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2023-12-02 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"]]