UnixSocketAddress
A single Unix socket address for SocketAddress
.
struct UnixSocketAddress
A single Unix socket address for SocketAddress
.
struct UnixSocketAddress
import NIOCore
The core abstractions that make up SwiftNIO.
enum SocketAddress
Represent a socket address to which we may want to connect or bind.
init(_ addr: sockaddr_in)
Creates a new IPv4 SocketAddress
.
init(_ addr: sockaddr_un)
Creates a new Unix Domain Socket SocketAddress
.
init(_ addr: sockaddr_in6)
Creates a new IPv6 SocketAddress
.
init(_ addr: sockaddr_in, host: String)
Creates a new IPv4 SocketAddress
.
init(_ addr: sockaddr_in6, host: String)
Creates a new IPv6 SocketAddress
.
init(ipAddress: String, port: Int) throws
Create a new SocketAddress
for an IP address in string form.
init(packedIPAddress: ByteBuffer, port: Int) throws
Create a new SocketAddress
for an IP address in ByteBuffer form.
init(unixDomainSocketPath: String) throws
Creates a new UDS SocketAddress
.
static func makeAddressResolvingHost(_ host: String, port: Int) throws -> SocketAddress
Creates a new SocketAddress
for the given host (which will be resolved) and port.
var description: String { get }
A human-readable description of this SocketAddress
. Mostly useful for logging.
var ipAddress: String? { get }
Get the IP address as a string
var isMulticast: Bool { get }
Whether this SocketAddress
corresponds to a multicast address.
var pathname: String? { get }
Get the pathname of a UNIX domain socket as a string
var port: Int? { get set }
Get and set the port associated with the address, if defined. When setting to nil
the port will default to 0
for compatible sockets. The rationale for this is that both nil
and 0
can be interpreted as “no preference”. Setting a non-nil value for a unix domain socket is invalid and will result in a fatal error.
var `protocol`: NIOBSDSocket.ProtocolFamily { get }
Returns the protocol family as defined in man 2 socket
of this SocketAddress
.
static func == (lhs: SocketAddress, rhs: SocketAddress) -> Bool
func hash(into hasher: inout Hasher)
func withSockAddr<T>(_ body: (UnsafePointer<sockaddr>, Int) throws -> T) rethrows -> T
Calls the given function with a pointer to a sockaddr
structure and the associated size of that structure.
struct IPv4Address
A single IPv4 address for SocketAddress
.
struct IPv6Address
A single IPv6 address for SocketAddress
.
var protocolFamily: Int32 { get }
protocol Sendable
var address: sockaddr_un { get }
The libc socket address for a Unix Domain Socket.