Artifact fdc6827f49c35b37591ab0e96ce643a8bc55319fa4a79a2545ac45bd89b790ac:
- File
src/exceptions/OFConnectionFailedException.h
— part of check-in
[44f45c2e35]
at
2017-01-09 17:36:36
on branch trunk
— Update copyright
Forgot to add 2017, even though I already did quite some changes in
2017. (user: js, size: 3122) [annotate] [blame] [check-ins using]
/* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 * Jonathan Schleifer <js@heap.zone> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif /*! * @class OFConnectionFailedException \ * OFConnectionFailedException.h ObjFW/OFConnectionFailedException.h * * @brief An exception indicating that a connection could not be established. */ @interface OFConnectionFailedException: OFException { id _socket; OFString *_host; uint16_t _port; int _errNo; } /*! * The socket which could not connect. */ @property (readonly, retain) id socket; /*! * The host to which the connection failed. */ @property (readonly, copy) OFString *host; /*! * The port on the host to which the connection failed. */ @property (readonly) uint16_t port; /*! * The errno of the error that occurred. */ @property (readonly) int errNo; /*! * @brief Creates a new, autoreleased connection failed exception. * * @param host The host to which the connection failed * @param port The port on the host to which the connection failed * @param socket The socket which could not connect * @return A new, autoreleased connection failed exception */ + (instancetype)exceptionWithHost: (OFString*)host port: (uint16_t)port socket: (id)socket; /*! * @brief Creates a new, autoreleased connection failed exception. * * @param host The host to which the connection failed * @param port The port on the host 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)exceptionWithHost: (OFString*)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo; /*! * @brief Initializes an already allocated connection failed exception. * * @param host The host to which the connection failed * @param port The port on the host to which the connection failed * @param socket The socket which could not connect * @return An initialized connection failed exception */ - initWithHost: (OFString*)host port: (uint16_t)port socket: (id)socket; /*! * @brief Initializes an already allocated connection failed exception. * * @param host The host to which the connection failed * @param port The port on the host 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 */ - initWithHost: (OFString*)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo; @end