Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion std/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ abstract class Address
// libraries shipped with DMD. Thus, we check for getnameinfo at
// runtime in the shared module constructor, and use it if it's
// available in the base class method. Classes for specific network
// families (e.g. InternetHost) override this method and use a
// families (e.g. InternetAddress) override this method and use a
// deprecated, albeit commonly-available method when getnameinfo()
// is not available.
// http://technet.microsoft.com/en-us/library/aa450403.aspx
Expand Down Expand Up @@ -1863,6 +1863,19 @@ public:
sin6 = addr;
}

version (Posix)
{
/// Human readable string representing the IPv6 address in RFC 2373 form.
override string toAddrString() @trusted const
{
char[INET6_ADDRSTRLEN] buf;
string addrString = to!string(
.inet_ntop(AddressFamily.INET6, &sin6.sin6_addr, buf.ptr, INET6_ADDRSTRLEN)
);
return addrString;
}
}

/**
* Parse an IPv6 host address string as described in RFC 2373, and return the
* address.
Expand Down
Loading