Struct SockAddr

A D representation of a sockaddr struct

struct SockAddr ;

This is how sockaddr might have looked like had C supported inheritence

Constructors

NameDescription
this Construct a SockAddr

Fields

NameTypeDescription
base core.sys.posix.sys.socket.sockaddrSockAddr as a sockaddr
ipv4 SockAddrIPv4SockAddr as a SockAddrIPv4
ipv6 SockAddrIPv6SockAddr as a SockAddrIPv6
unix SockAddrUnixSockAddr as a SockAddrUnix

Properties

NameTypeDescription
family[get] ushortReturn the address family
len[get] uintReturns the length of the data in the struct

Methods

NameDescription
resolve Perform a name resolution on the given string
toString Return a GC allocated string representing the address
toStringAddr Convert just the address part to a GC allocated string
toStringPort Convert just the port part to a GC allocated string