Skip to content

Commit f0735e8

Browse files
authored
Merge pull request #147 from gregcotten/expose-unlink
2 parents c11f6b7 + 81cbc4e commit f0735e8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

FlyingSocks/Sources/SocketAddress.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ extension Socket {
197197
}
198198
}
199199

200+
public static func unlink(_ address: sockaddr_un) throws {
201+
var address = address
202+
guard Socket.unlink(&address.sun_path.0) == 0 else {
203+
throw SocketError.makeFailed("unlink")
204+
}
205+
}
206+
200207
static func makeAddressINET(fromIP4 ip: String, port: UInt16) throws -> sockaddr_in {
201208
var address = Socket.makeAddressINET(port: port)
202209
address.sin_addr = try Socket.makeInAddr(fromIP4: ip)
@@ -218,13 +225,6 @@ extension Socket {
218225
}
219226
return addr
220227
}
221-
222-
static func unlink(_ address: sockaddr_un) throws {
223-
var address = address
224-
guard Socket.unlink(&address.sun_path.0) == 0 else {
225-
throw SocketError.makeFailed("unlink")
226-
}
227-
}
228228
}
229229

230230
public struct AnySocketAddress: Sendable, SocketAddress {

0 commit comments

Comments
 (0)