View source code
							
							
						
								Display the source code in std/socket.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								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.
							
						Module std.socket
Socket primitives.
Example
Functions
| Name | Description | 
|---|---|
| 
									getAddress(hostname, service)
								 | Provides protocol-independent translation from host names to socket
 addresses. Uses getAddressInfoif the current system supports it,
 andInternetHostotherwise. | 
| 
									getAddressInfo(node, options)
								 | Provides protocol-independent translation from host names to socket
 addresses. If advanced functionality is not required, consider using getAddressfor compatibility with older systems. | 
| 
									lastSocketError()
								 | Retrieve the error message for the most recently encountered network error. | 
| 
									parseAddress(hostaddr, service)
								 | Provides protocol-independent parsing of network addresses. Does not
 attempt name resolution. Uses getAddressInfowithAddressInfoFlagsif the current system supports it, andInternetAddressotherwise. | 
| 
									socketPair()
								 | Creates a pair of connected sockets. | 
| 
									wouldHaveBlocked()
								 | 
Classes
| Name | Description | 
|---|---|
| 
									Address
								 | Addressis an abstract class for representing a socket addresses. | 
| 
									AddressException
								 | Class for exceptions thrown from an Address. | 
| 
									HostException
								 | Class for exceptions thrown from an InternetHost. | 
| 
									Internet6Address
								 | Internet6Addressencapsulates an IPv6 (Internet Protocol version 6)
 socket address. | 
| 
									InternetAddress
								 | InternetAddressencapsulates an IPv4 (Internet Protocol version 4)
 socket address. | 
| 
									InternetHost
								 | InternetHostis a class for resolving IPv4 addresses. | 
| 
									Protocol
								 | Protocolis a class for retrieving protocol information. | 
| 
									Service
								 | Serviceis a class for retrieving service information. | 
| 
									Socket
								 | Socketis a class that creates a network communication endpoint using
 the Berkeley sockets interface. | 
| 
									SocketAcceptException
								 | Class for exceptions thrown by Socket. | 
| 
									SocketException
								 | Base exception thrown by std. | 
| 
									SocketFeatureException
								 | Socket exceptions representing attempts to use network capabilities not available on the current system. | 
| 
									SocketOSException
								 | Socket exceptions representing network errors reported by the operating system. | 
| 
									SocketParameterException
								 | Socket exceptions representing invalid parameters specified by user code. | 
| 
									SocketSet
								 | A collection of sockets for use with Socket. | 
| 
									TcpSocket
								 | TcpSocketis a shortcut class for a TCP Socket. | 
| 
									UdpSocket
								 | UdpSocketis a shortcut class for a UDP Socket. | 
| 
									UnixAddress
								 | UnixAddressencapsulates an address for a Unix domain socket
 (AF_UNIX), i.e. a socket bound to a path name in the file system.
 Available only on supported systems. | 
| 
									UnknownAddress
								 | UnknownAddressencapsulates an unknown socket address. | 
| 
									UnknownAddressReference
								 | UnknownAddressReferenceencapsulates a reference to an arbitrary
 socket address. | 
Structs
| Name | Description | 
|---|---|
| 
									AddressInfo
								 | Holds information about a socket address retrieved by getAddressInfo. | 
| 
									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
								 | A subset of flags supported on all platforms with getaddrinfo.
 Specifies option flags for getAddressInfo. | 
| 
									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
License
					Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.