Network: Add ResolveError handling
Former-commit-id: 0dc3d109284e8b475577bf44cbaeb503c4baae73
This commit is contained in:
@@ -9,6 +9,22 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
enum ResolveError
|
||||
{
|
||||
ResolveError_NoError,
|
||||
|
||||
ResolveError_Internal, //< An internal error occured
|
||||
ResolveError_ResourceError, //< The operating system lacks the resources to proceed (insufficient memory)
|
||||
ResolveError_NonRecoverable, //< An nonrecoverable error occured
|
||||
ResolveError_NotFound, //< No such host is known
|
||||
ResolveError_NotInitialized, //< Nazara network has not been initialized
|
||||
ResolveError_ProtocolNotSupported, //< A specified protocol is not supported by the server
|
||||
ResolveError_TemporaryFailure, //< A temporary failure occured, try again
|
||||
ResolveError_Unknown, //< The last operation failed with an unlisted error code
|
||||
|
||||
ResolveError_Max = ResolveError_TemporaryFailure
|
||||
};
|
||||
|
||||
enum NetProtocol
|
||||
{
|
||||
NetProtocol_Any,
|
||||
|
||||
@@ -55,8 +55,8 @@ namespace Nz
|
||||
IpAddress& operator=(const IpAddress&) = default;
|
||||
IpAddress& operator=(IpAddress&&) = default;
|
||||
|
||||
static String ResolveAddress(const IpAddress& address, String* service = nullptr);
|
||||
static std::vector<HostnameInfo> ResolveHostname(NetProtocol procol, const String& hostname, const String& protocol = "http");
|
||||
static String ResolveAddress(const IpAddress& address, String* service = nullptr, ResolveError* error = nullptr);
|
||||
static std::vector<HostnameInfo> ResolveHostname(NetProtocol procol, const String& hostname, const String& protocol = "http", ResolveError* error = nullptr);
|
||||
|
||||
inline friend std::ostream& operator<<(std::ostream& out, const IpAddress& address);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user