Address
public enum Address
Address is a resolved network address.
-
Undocumented
Declaration
Swift
public enum Address
-
Undocumented
Declaration
Swift
public enum Address
-
Undocumented
Declaration
Swift
public enum Address
-
Creates an Address from the specified IP address, port number and scope ID. If
ip
is an IPv4 address,scopeID
is ignored.Declaration
Swift
public init?(ip: IPAddress, port: Int, scopeID: Int = 0)
-
Creates a UNIX Domain Socket address using the specified
path
.Declaration
Swift
public init?(path: String)
-
Returns the socket family for this address.
Declaration
Swift
public var family: Family
-
Resolves the provided
host
and/orservice
using the specified flags, family and socket type. See getaddrinfo(2) for details.Declaration
Swift
public static func resolve(host: String? = nil, service: String? = nil, flags: Flags = .default, family: Family? = nil, type: SocketType? = nil, proto: SocketProtocol? = nil) throws -> (cname: String, addresses: [Address])
-
Combines host and port into a network address of the form
host:port
or[host]:port
if the host contains a colon or a percent sign.Declaration
Swift
public static func join(host: String, port: String) -> String
-
Splits a network address of the form
host:port
,[host]:port
or[ipv6-host%zone]:port
into host or ipv6-host%zone and port.Declaration
Swift
public static func split(hostPort: String) throws -> (String, String)
-
Flags that alter the behaviour of Address.resolve.
See moreDeclaration
Swift
public struct Flags: OptionSet
-
Equatable implementation for Address.
Declaration
Swift
public static func ==(lhs: Address, rhs: Address) -> Bool