@@ -14,52 +14,60 @@ * file. */ #import "OFException.h" +@class OFTCPSocket; + /** * \brief An exception indicating that a connection could not be established. */ @interface OFConnectionFailedException: OFException { - OFString *host; - uint16_t port; - int errNo; + OFTCPSocket *socket; + OFString *host; + uint16_t port; + int errNo; } #ifdef OF_HAVE_PROPERTIES +@property (readonly, nonatomic) OFTCPSocket *socket; @property (readonly, nonatomic) OFString *host; @property (readonly) uint16_t port; @property (readonly) int errNo; #endif /** * \param class_ The class of the object which caused the exception + * \param socket The socket which could not connect * \param host The host to which the connection failed * \param port The port on the host to which the connection failed * \return A new connection failed exception */ + newWithClass: (Class)class_ + socket: (OFTCPSocket*)socket host: (OFString*)host port: (uint16_t)port; /** * Initializes an already allocated connection failed exception. * * \param class_ The class of the object which caused the exception + * \param socket The socket which could not connect * \param host The host to which the connection failed * \param port The port on the host to which the connection failed * \return An initialized connection failed exception */ - initWithClass: (Class)class_ + socket: (OFTCPSocket*)socket host: (OFString*)host port: (uint16_t)port; /** - * \return The errno from when the exception was created + * \return The socket which could not connect */ -- (int)errNo; +- (OFTCPSocket*)socket; /** * \return The host to which the connection failed */ - (OFString*)host; @@ -66,6 +74,11 @@ /** * \return The port on the host to which the connection failed */ - (uint16_t)port; + +/** + * \return The errno from when the exception was created + */ +- (int)errNo; @end