Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions FlyingSocks/Sources/SocketAddress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ extension Socket {
}
}

public static func unlink(_ address: sockaddr_un) throws {
var address = address
guard Socket.unlink(&address.sun_path.0) == 0 else {
throw SocketError.makeFailed("unlink")
}
}

static func makeAddressINET(fromIP4 ip: String, port: UInt16) throws -> sockaddr_in {
var address = Socket.makeAddressINET(port: port)
address.sin_addr = try Socket.makeInAddr(fromIP4: ip)
Expand All @@ -218,13 +225,6 @@ extension Socket {
}
return addr
}

static func unlink(_ address: sockaddr_un) throws {
var address = address
guard Socket.unlink(&address.sun_path.0) == 0 else {
throw SocketError.makeFailed("unlink")
}
}
}

public struct AnySocketAddress: Sendable, SocketAddress {
Expand Down