Index: src/exceptions/OFAcceptFailedException.h ================================================================== --- src/exceptions/OFAcceptFailedException.h +++ src/exceptions/OFAcceptFailedException.h @@ -20,51 +20,49 @@ #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif -@class OFTCPSocket; - /*! * @brief An exception indicating that accepting a connection failed. */ @interface OFAcceptFailedException: OFException { - OFTCPSocket *_socket; + id _socket; int _errNo; } #ifdef OF_HAVE_PROPERTIES -@property (readonly, retain) OFTCPSocket *socket; +@property (readonly, retain) id socket; @property (readonly) int errNo; #endif /*! * @brief Creates a new, autoreleased accept failed exception. * * @param socket The socket which could not accept a connection * @return A new, autoreleased accept failed exception */ -+ (instancetype)exceptionWithSocket: (OFTCPSocket*)socket; ++ (instancetype)exceptionWithSocket: (id)socket; /*! * @brief Initializes an already allocated accept failed exception. * * @param socket The socket which could not accept a connection * @return An initialized accept failed exception */ -- initWithSocket: (OFTCPSocket*)socket; +- initWithSocket: (id)socket; /*! * @brief Returns the socket which could not accept a connection. * * @return The socket which could not accept a connection */ -- (OFTCPSocket*)socket; +- (id)socket; /*! * @brief Returns the errno from when the exception was created. * * @return The errno from when the exception was created */ - (int)errNo; @end Index: src/exceptions/OFAcceptFailedException.m ================================================================== --- src/exceptions/OFAcceptFailedException.m +++ src/exceptions/OFAcceptFailedException.m @@ -16,27 +16,26 @@ #include "config.h" #import "OFAcceptFailedException.h" #import "OFString.h" -#import "OFTCPSocket.h" #import "common.h" #import "macros.h" @implementation OFAcceptFailedException -+ (instancetype)exceptionWithSocket: (OFTCPSocket*)socket ++ (instancetype)exceptionWithSocket: (id)socket { return [[[self alloc] initWithSocket: socket] autorelease]; } - init { OF_INVALID_INIT_METHOD } -- initWithSocket: (OFTCPSocket*)socket +- initWithSocket: (id)socket { self = [super init]; _socket = [socket retain]; _errNo = GET_SOCK_ERRNO; @@ -56,11 +55,11 @@ return [OFString stringWithFormat: @"Failed to accept connection in socket of class %@! " ERRFMT, [_socket class], ERRPARAM]; } -- (OFTCPSocket*)socket +- (id)socket { OF_GETTER(_socket, true) } - (int)errNo Index: src/exceptions/OFAlreadyConnectedException.h ================================================================== --- src/exceptions/OFAlreadyConnectedException.h +++ src/exceptions/OFAlreadyConnectedException.h @@ -18,43 +18,41 @@ #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif -@class OFTCPSocket; - /*! * @brief An exception indicating an attempt to connect or bind an already * connected or bound socket. */ @interface OFAlreadyConnectedException: OFException { - OFTCPSocket *_socket; + id _socket; } #ifdef OF_HAVE_PROPERTIES -@property (readonly, retain) OFTCPSocket *socket; +@property (readonly, retain) id socket; #endif /*! * @brief Creates a new, autoreleased already connected exception. * * @param socket The socket which is already connected * @return A new, autoreleased already connected exception */ -+ (instancetype)exceptionWithSocket: (OFTCPSocket*)socket; ++ (instancetype)exceptionWithSocket: (id)socket; /*! * @brief Initializes an already allocated already connected exception. * * @param socket The socket which is already connected * @return An initialized already connected exception */ -- initWithSocket: (OFTCPSocket*)socket; +- initWithSocket: (id)socket; /*! * @brief Returns the socket which is already connected. * * @return The socket which is already connected */ -- (OFTCPSocket*)socket; +- (id)socket; @end Index: src/exceptions/OFAlreadyConnectedException.m ================================================================== --- src/exceptions/OFAlreadyConnectedException.m +++ src/exceptions/OFAlreadyConnectedException.m @@ -16,21 +16,20 @@ #include "config.h" #import "OFAlreadyConnectedException.h" #import "OFString.h" -#import "OFTCPSocket.h" #import "common.h" @implementation OFAlreadyConnectedException -+ (instancetype)exceptionWithSocket: (OFTCPSocket*)socket ++ (instancetype)exceptionWithSocket: (id)socket { return [[[self alloc] initWithSocket: socket] autorelease]; } -- initWithSocket: (OFTCPSocket*)socket +- initWithSocket: (id)socket { self = [super init]; _socket = [socket retain]; @@ -53,10 +52,10 @@ [_socket class]]; else return @"A connection has already been established!"; } -- (OFTCPSocket*)socket +- (id)socket { OF_GETTER(_socket, true) } @end Index: src/exceptions/OFConnectionFailedException.h ================================================================== --- src/exceptions/OFConnectionFailedException.h +++ src/exceptions/OFConnectionFailedException.h @@ -20,25 +20,23 @@ #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif -@class OFTCPSocket; - /*! * @brief An exception indicating that a connection could not be established. */ @interface OFConnectionFailedException: OFException { - OFTCPSocket *_socket; - OFString *_host; - uint16_t _port; - int _errNo; + id _socket; + OFString *_host; + uint16_t _port; + int _errNo; } #ifdef OF_HAVE_PROPERTIES -@property (readonly, retain) OFTCPSocket *socket; +@property (readonly, retain) id socket; @property (readonly, copy) OFString *host; @property (readonly) uint16_t port; @property (readonly) int errNo; #endif @@ -50,11 +48,11 @@ * @param socket The socket which could not connect * @return A new, autoreleased connection failed exception */ + (instancetype)exceptionWithHost: (OFString*)host port: (uint16_t)port - socket: (OFTCPSocket*)socket; + socket: (id)socket; /*! * @brief Initializes an already allocated connection failed exception. * * @param host The host to which the connection failed @@ -62,18 +60,18 @@ * @param socket The socket which could not connect * @return An initialized connection failed exception */ - initWithHost: (OFString*)host port: (uint16_t)port - socket: (OFTCPSocket*)socket; + socket: (id)socket; /*! * @brief Returns the socket which could not connect. * * @return The socket which could not connect */ -- (OFTCPSocket*)socket; +- (id)socket; /*! * @brief Returns the host to which the connection failed. * * @return The host to which the connection failed Index: src/exceptions/OFConnectionFailedException.m ================================================================== --- src/exceptions/OFConnectionFailedException.m +++ src/exceptions/OFConnectionFailedException.m @@ -16,19 +16,18 @@ #include "config.h" #import "OFConnectionFailedException.h" #import "OFString.h" -#import "OFTCPSocket.h" #import "common.h" #import "macros.h" @implementation OFConnectionFailedException + (instancetype)exceptionWithHost: (OFString*)host port: (uint16_t)port - socket: (OFTCPSocket*)socket + socket: (id)socket { return [[[self alloc] initWithHost: host port: port socket: socket] autorelease]; } @@ -38,11 +37,11 @@ OF_INVALID_INIT_METHOD } - initWithHost: (OFString*)host port: (uint16_t)port - socket: (OFTCPSocket*)socket + socket: (id)socket { self = [super init]; @try { _host = [host copy]; @@ -81,11 +80,11 @@ - (uint16_t)port { return _port; } -- (OFTCPSocket*)socket +- (id)socket { OF_GETTER(_socket, true) } - (int)errNo