vibe.d beta banner
get vibe.d

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

Interface EventDriverSockets

Provides access to socket functionality.

interface EventDriverSockets ;

The interface supports two classes of sockets - stream sockets and datagram sockets.


userData[set] TRetrieves a reference to a user-defined value associated with a descriptor.


addRef Increments the reference count of the given socket.
adoptDatagramSocket Adopts an existing datagram socket.
adoptStream Adopts an existing stream socket.
cancelConnectStream Aborts asynchronous connect by closing the socket.
cancelRead Cancels an ongoing read operation.
cancelReceive Cancels an ongoing wait for an incoming datagram.
cancelSend Cancels an ongoing wait for an outgoing datagram.
cancelWrite Cancels an ongoing write operation.
connectStream Connects to a stream listening socket.
createDatagramSocket Creates a connection-less datagram socket.
getConnectionState Determines the current connection state.
getLocalAddress Retrieves the bind address of a socket.
getRemoteAddress Retrieves the address of the connected peer.
joinMulticastGroup Joins the multicast group associated with the given IP address.
listenStream Creates a socket listening for incoming stream connections.
read Reads data from a stream socket.
receive Receives a single datagram.
releaseRef Decrements the reference count of the given socket.
send Sends a single datagram.
setBroadcast Sets the SO_BROADCAST socket option.
setKeepAlive Sets to SO_KEEPALIVE socket option on a socket.
setKeepAliveParams Enables keepalive for the TCP socket and sets additional parameters. Silently ignores unsupported systems (anything but Windows and Linux).
setOption Enables or disables a socket option.
setTargetAddress Sets an address to use as the default target address for sent datagrams.
setTCPNoDelay Sets the TCP_NODELAY option on a socket
setUserTimeout Sets TCP_USER_TIMEOUT socket option (linux only).
shutdown Initiates a connection close.
waitForConnections Starts to wait for incoming connections on a listening socket.
waitForData Waits for incoming data without actually reading it.
write Reads data from a stream socket.
rawUserData Low-level user data access. Use getUserData instead.