vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function EventDriverSockets.getLocalAddress

Retrieves the bind address of a socket.

abstract bool getLocalAddress (
  SocketFD sock,
  scope RefAddress dst
) nothrow @safe;

Example

The following code can be used to retrieve an IPv4/IPv6 address allocated on the stack. Note that Unix domain sockets require a larger buffer (e.g. sockaddr_storage).

scope storage = new UnknownAddress;
scope sockaddr = new RefAddress(storage.name, storage.nameLen);
eventDriver.sockets.getLocalAddress(sock, sockaddr);
Authors
Copyright
License