Skip to content

Commit 46c1290

Browse files
committed
add address property accessor in IORingUtils Message extension
1 parent 3c246a0 commit 46c1290

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/IORingUtils/Extensions.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ extension Message: CustomStringConvertible {
4545
}
4646

4747
public var description: String {
48-
let address = (try? sockaddr_storage(bytes: name).presentationAddress) ?? "<unknown>"
48+
let address = (try? address.presentationAddress) ?? "<unknown>"
4949
return "\(type(of: self))(address: \(address), buffer: \(hexDescription(buffer)), flags: \(flags))"
5050
}
51+
52+
public var address: any SocketAddress {
53+
get throws {
54+
try sockaddr_storage(bytes: name)
55+
}
56+
}
5157
}
5258

5359
public extension IORing {

0 commit comments

Comments
 (0)