ObjFW
OFResolveHostFailedException.h
1 /*
2  * Copyright (c) 2008-2023 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFException.h"
17 #import "OFDNSResolver.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
28 {
29  OFString *_host;
30  OFSocketAddressFamily _addressFamily;
31  OFDNSResolverErrorCode _errorCode;
32  OF_RESERVE_IVARS(OFResolveHostFailedException, 4)
33 }
34 
38 @property (readonly, nonatomic) OFString *host;
39 
43 @property (readonly, nonatomic) OFSocketAddressFamily addressFamily;
44 
48 @property (readonly, nonatomic) OFDNSResolverErrorCode errorCode;
49 
59 + (instancetype)exceptionWithHost: (OFString *)host
60  addressFamily: (OFSocketAddressFamily)addressFamily
61  errorCode: (OFDNSResolverErrorCode)errorCode;
62 
63 + (instancetype)exception OF_UNAVAILABLE;
64 
74 - (instancetype)initWithHost: (OFString *)host
75  addressFamily: (OFSocketAddressFamily)addressFamily
76  errorCode: (OFDNSResolverErrorCode)errorCode;
77 
78 - (instancetype)init OF_UNAVAILABLE;
79 @end
80 
81 OF_ASSUME_NONNULL_END
A class for handling strings.
Definition: OFString.h:134
An exception indicating that resolving a host failed.
Definition: OFResolveHostFailedException.h:27
The base class for all exceptions in ObjFW.
Definition: OFException.h:150
OFSocketAddressFamily
A socket address family.
Definition: OFSocket.h:103