@@ -18,10 +18,12 @@ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif + +#import "socket.h" OF_ASSUME_NONNULL_BEGIN /*! * @class OFConnectionFailedException \ @@ -32,10 +34,12 @@ @interface OFConnectionFailedException: OFException { id _socket; OFString *_host; uint16_t _port; + unsigned char _node[IPX_NODE_LEN]; + uint32_t _network; int _errNo; } /*! * @brief The socket which could not connect. @@ -50,10 +54,20 @@ /*! * @brief The port on the host to which the connection failed. */ @property (readonly, nonatomic) uint16_t port; +/*! + * @brief The IPX node to which the connection failed. + */ +@property (readonly, nonatomic) unsigned char *node; + +/*! + * @brief The IPX network of the node to which the connection failed. + */ +@property (readonly, nonatomic) uint32_t network; + /*! * @brief The errno of the error that occurred. */ @property (readonly, nonatomic) int errNo; @@ -71,10 +85,26 @@ + (instancetype)exceptionWithHost: (nullable OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo; +/*! + * @brief Creates a new, autoreleased connection failed exception. + * + * @param node The node to which the connection failed + * @param network The IPX network of the node to which the connection failed + * @param port The port on the node to which the connection failed + * @param socket The socket which could not connect + * @param errNo The errno of the error that occurred + * @return A new, autoreleased connection failed exception + */ ++ (instancetype)exceptionWithNode: (unsigned char [_Nullable IPX_NODE_LEN])node + network: (uint32_t)network + port: (uint16_t)port + socket: (id)socket + errNo: (int)errNo; + - (instancetype)init OF_UNAVAILABLE; /*! * @brief Initializes an already allocated connection failed exception. * @@ -85,9 +115,25 @@ * @return An initialized connection failed exception */ - (instancetype)initWithHost: (nullable OFString *)host port: (uint16_t)port socket: (id)socket - errNo: (int)errNo OF_DESIGNATED_INITIALIZER; + errNo: (int)errNo; + +/*! + * @brief Initializes an already allocated connection failed exception. + * + * @param node The node to which the connection failed + * @param network The IPX network of the node to which the connection failed + * @param port The port on the node to which the connection failed + * @param socket The socket which could not connect + * @param errNo The errno of the error that occurred + * @return An initialized connection failed exception + */ +- (instancetype)initWithNode: (unsigned char [_Nullable IPX_NODE_LEN])node + network: (uint32_t)network + port: (uint16_t)port + socket: (id)socket + errNo: (int)errNo; @end OF_ASSUME_NONNULL_END