@[extern lean_sockaddr_mk]
constant
Socket.SockAddr.mk
(host : String)
(port : String)
(family : optParam Socket.AddressFamily Socket.AddressFamily.unspecified)
(type : optParam Socket.SockType Socket.SockType.unspecified)
:
Create a SockAddr
.
@[extern lean_sockaddr_family]
Get family of the SockAddr
.
@[extern lean_sockaddr_port]
Get family of the SockAddr
.
@[extern lean_sockaddr_host]
Get family of the SockAddr
.
Equations
- Socket.instToStringSockAddr = { toString := fun a => let host := Option.getD (Socket.SockAddr.host a) "none"; let port := Option.getD (Option.map (fun a => toString "" ++ toString a ++ toString "") (Socket.SockAddr.port a)) "none"; let family := Option.getD (Option.map (fun a => toString "" ++ toString a ++ toString "") (Socket.SockAddr.family a)) "none"; toString "(" ++ toString host ++ toString ", " ++ toString port ++ toString ", " ++ toString family ++ toString ")" }