View source code
Display the source code in std/socket.d from which this page was generated on
github.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Page wiki
View or edit the community-maintained wiki page associated with this page.
Module std.socket
Socket
primitives.
Example
Functions
Name | Description |
---|---|
getAddress
|
Provides protocol-independent translation from host names to socket
addresses. Uses if the current system supports it,
and otherwise.
|
getAddressInfo
|
Provides protocol-independent translation from host names to socket
addresses. If advanced functionality is not required, consider using
for compatibility with older systems.
|
lastSocketError
|
Retrieve the error message for the most recently encountered network error. |
parseAddress
|
Provides protocol-independent parsing of network addresses. Does not
attempt name resolution. Uses with
if the current system supports it, and
otherwise.
|
socketPair
|
Creates a pair of connected sockets. |
wouldHaveBlocked
|
Return true if the last socket operation failed because the socket
|
Classes
Name | Description |
---|---|
Address
|
is an abstract class for representing a socket addresses.
|
AddressException
|
Class for exceptions thrown from an .
|
HostException
|
Class for exceptions thrown from an .
|
Internet6Address
|
encapsulates an IPv6 (Internet Protocol version 6)
socket address.
|
InternetAddress
|
encapsulates an IPv4 (Internet Protocol version 4)
socket address.
|
InternetHost
|
is a class for resolving IPv4 addresses.
|
Protocol
|
is a class for retrieving protocol information.
|
Service
|
is a class for retrieving service information.
|
Socket
|
is a class that creates a network communication endpoint using
the Berkeley sockets interface.
|
SocketAcceptException
|
Class for exceptions thrown by .
|
SocketException
|
Base exception thrown by .
|
SocketFeatureException
|
Socket exceptions representing attempts to use network capabilities not
|
SocketOSException
|
Socket exceptions representing network errors reported by the operating
|
SocketParameterException
|
Socket exceptions representing invalid parameters specified by user code.
|
SocketSet
|
A collection of sockets for use with .
|
TcpSocket
|
is a shortcut class for a TCP Socket .
|
UdpSocket
|
is a shortcut class for a UDP Socket .
|
UnixAddress
|
encapsulates an address for a Unix domain socket
(AF_UNIX ). Available only on supported systems.
|
UnknownAddress
|
encapsulates an unknown socket address.
|
UnknownAddressReference
|
encapsulates a reference to an arbitrary
socket address.
|
Structs
Name | Description |
---|---|
AddressInfo
|
Holds information about a socket address retrieved by .
|
Linger
|
Linger information for use with SocketOption.LINGER .
|
TimeVal
|
Duration timeout value. |
Enums
Name | Description |
---|---|
AddressFamily
|
The communication domain used to resolve an address. |
AddressInfoFlags
|
Specifies option flags for .
|
ProtocolType
|
Protocol
|
SocketFlags
|
Flags may be OR'ed together: |
SocketOption
|
Specifies a socket option: |
SocketOptionLevel
|
The level at which a socket option is defined: |
SocketShutdown
|
How a socket is shutdown: |
SocketType
|
Communication semantics |
Authors
Christopher E. Miller, David Nadlinger, Vladimir Panteleev