xentara-utils v2.0.4
The Xentara Utility Library
|
Networking functionality. More...
Classes | |
class | Address |
A network address. More... | |
class | Backlog |
Marker for listening backlog. More... | |
class | BadAddressStringError |
An Exception that is thrown when a numeric address string had a bad format. More... | |
class | HostNotFoundError |
An Exception that is thrown when a host name lookup failed. More... | |
class | IllegalPortNumberError |
An Exception that is thrown when a port number is out of range. More... | |
class | MissingPortNumberError |
An Exception that is thrown when a host name/port number pair does not contain a port number. More... | |
struct | NonBlockingTag |
Type used to specify that a socket should be non blocking. More... | |
struct | RequirePortTag |
Type used to specify that a host name or address string must include a port number. More... | |
class | Socket |
A socket. More... | |
class | SocketDevice |
A stream socket that implements io::InputDevice and io::OutputDevice. More... | |
class | SocketServer |
A class to create a socket server. More... | |
class | SocketStream |
A stream socket that implements io::InputStream and io::OutputStream. More... | |
class | Timeout |
Marker for timeout value. More... | |
class | WithStopSource |
Marker for using a stop source. More... | |
Concepts | |
concept | SockaddrCompatible |
A concept describing types that can be used as socket addresses. | |
Typedefs | |
using | PortNumber = decltype(std::declval< sockaddr_in >().sin_port) |
The type for an IP port number. | |
Enumerations | |
enum class | DefaultPort : PortNumber |
Marker for host names/address strings with optional port number. More... | |
enum class | WithPort : PortNumber |
Marker used to specify a fixed port for host names/address strings. More... | |
enum class | AddressFamily : int |
Marker for address families. More... | |
enum class | SocketType : int |
Marker for socket types. More... | |
enum class | Protocol : int |
Marker for protocols. More... | |
Functions | |
auto | initWindowsSockets () -> void |
Initializes the Windows socket subsystem (WinSock) | |
Variables | |
constexpr RequirePortTag | kRequirePort |
A marker for host names/address strings with port number. | |
constexpr NonBlockingTag | kNonBlocking |
A marker for creating non-blocking sockets. | |
Networking functionality.
This namespace contains networking functionality.
using xentara::utils::network::PortNumber = typedef decltype(std::declval<sockaddr_in>().sin_port) |
The type for an IP port number.
#include <xentara/utils/network/Types.hpp>
|
strong |
Marker for address families.
This marker is used to specify an address family in the style of AF_INET, AF_INET6
, AF_UNSPEC etc.
Just cast the appropriate define to AddressFamily:
#include <xentara/utils/network/Options.hpp>
|
strong |
Marker for host names/address strings with optional port number.
This marker is used to specify that a host name or address string may include a port number, and specifies the default port number to use if none is specified.
Just cast the default port number to DefaultPort:
#include <xentara/utils/network/Options.hpp>
|
strong |
|
strong |
Marker for socket types.
This marker is used to specify a socket type in the style of SOCK_STREAM
or `SOCK_DGRAM.
Just cast the appropriate define to `SocketType:
#include <xentara/utils/network/Options.hpp>
|
strong |
Marker used to specify a fixed port for host names/address strings.
This marker is used to specify that a host name or address string may not include a port number, but a fixed port should be used.
Just cast the default port number to WithPort:
#include <xentara/utils/network/Options.hpp>
auto xentara::utils::network::initWindowsSockets | ( | ) | -> void |
Initializes the Windows socket subsystem (WinSock)
You can call this function if you which to use Windows socket functions without using any classes from the xentara::utils::network namespace. You do not have to call this function if you have already created any addresses or sockets using xentara::utils::network::Address or xentara::utils::network::Socket, as these initialize WinSock automatically.
This function is a noop under all operating systems except Windows.
|
constexpr |
A marker for creating non-blocking sockets.
This marker is used to specify that a socket should be non-blocking
#include <xentara/utils/network/Options.hpp>
|
constexpr |
A marker for host names/address strings with port number.
This marker is used to specify that a host name or address string must include a port number
#include <xentara/utils/network/Options.hpp>