Loading...
Searching...
No Matches
IpAddress.hpp
Go to the documentation of this file.
7// In no event will the authors be held liable for any damages arising from the use of this software.
392SFML_NETWORK_API std::istream& operator>>(std::istream& stream, std::optional<IpAddress>& address);
static std::optional< IpAddress > getPublicAddress(Time timeout=Time::Zero, std::optional< Type > type=Type::IpV4, bool secure=false)
Get the computer's public address.
static std::optional< IpAddress > resolve(std::string_view address)
Construct the address from a null-terminated string view.
IpAddress(std::array< std::uint8_t, 16 > bytes)
Construct an IPv6 address from 16 bytes.
std::uint32_t toInteger() const
Get an integer representation of the address.
IpAddress(std::uint32_t address)
Construct an IPv4 address from a 32-bit integer.
static const IpAddress BroadcastV4
The "broadcast" IPv4 address (for sending UDP messages to everyone on a local network).
Definition IpAddress.hpp:293
static const IpAddress LocalHostV4
The "localhost" IPv4 address (for connecting a computer to itself locally).
Definition IpAddress.hpp:292
friend bool operator<(IpAddress left, IpAddress right)
Overload of operator< to compare two IP addresses.
IpAddress(std::uint8_t byte0, std::uint8_t byte1, std::uint8_t byte2, std::uint8_t byte3)
Construct an IPv4 address from 4 bytes.
static std::optional< IpAddress > fromString(std::string_view address)
Try to construct an address from its string representation.
static const IpAddress AnyV4
Value representing any IPv4 address (0.0.0.0).
Definition IpAddress.hpp:291
static std::optional< IpAddress > getLocalAddress(Type type=Type::IpV4)
Get the computer's local address.
static const IpAddress LocalHostV6
The "localhost" IPv6 address (for connecting a computer to itself locally).
Definition IpAddress.hpp:295
std::array< std::uint8_t, 16 > toBytes() const
Get an array of bytes representing the address.
Definition AudioResource.hpp:36
bool operator!=(IpAddress left, IpAddress right)
Overload of operator!= to compare two IP addresses.
bool operator<(IpAddress left, IpAddress right)
Overload of operator< to compare two IP addresses.
bool operator==(IpAddress left, IpAddress right)
Overload of operator== to compare two IP addresses.
bool operator>(IpAddress left, IpAddress right)
Overload of operator> to compare two IP addresses.
bool operator>=(IpAddress left, IpAddress right)
Overload of operator>= to compare two IP addresses.
std::istream & operator>>(std::istream &stream, std::optional< IpAddress > &address)
Overload of operator>> to extract an IP address from an input stream.
bool operator<=(IpAddress left, IpAddress right)
Overload of operator<= to compare two IP addresses.
std::ostream & operator<<(std::ostream &stream, IpAddress address)
Overload of operator<< to print an IP address to an output stream.