SockAddrIPv4

A D representation of the sockaddr_in struct

Constructors

this
this(in_addr addr, ushort port)
this(string addr, ushort port)
this(sockaddr* sa, socklen_t length)
this(IPv4 addr, ushort port)

Construct a SockAddrIPv4

Members

Functions

toFixedStringAddr
auto toFixedStringAddr()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()

Convert the address to GC allocated string in the format addr:port

toStringAddr
string toStringAddr()

Convert just the address part to a GC allocated string

toStringPort
string toStringPort()

Convert just the port part to a GC allocated string

Manifest constants

PORT_ANY
enum PORT_ANY;

Unspecified port constant

Properties

addr
IPv4 addr [@property setter]
IPv4 addr [@property getter]

Get/set the sa's addr

port
ushort port [@property setter]
ushort port [@property getter]

Get/set the sa's port in host byte order

Static functions

any
SockAddrIPv4 any(ushort port)

Construct an any sockaddr for the given port

broadcast
SockAddrIPv4 broadcast(ushort port)

Construct a broadcast sockaddr for the given port

loopback
SockAddrIPv4 loopback(ushort port)

Construct a loopback sockaddr for the given port

Variables

sa
sockaddr_in sa;

the underlying sockaddr_in struct

Meta