@@ -23,18 +23,16 @@ #import "OFTCPSocket.h" #import "common.h" @implementation OFAlreadyConnectedException -+ (instancetype)exceptionWithClass: (Class)class - socket: (OFTCPSocket*)socket ++ (instancetype)exceptionWithSocket: (OFTCPSocket*)socket { - return [[[self alloc] initWithClass: class - socket: socket] autorelease]; + return [[[self alloc] initWithSocket: socket] autorelease]; } -- initWithClass: (Class)class +- init { @try { [self doesNotRecognizeSelector: _cmd]; } @catch (id e) { [self release]; @@ -42,14 +40,13 @@ } abort(); } -- initWithClass: (Class)class - socket: (OFTCPSocket*)socket +- initWithSocket: (OFTCPSocket*)socket { - self = [super initWithClass: class]; + self = [super init]; _socket = [socket retain]; return self; } @@ -63,13 +60,13 @@ - (OFString*)description { return [OFString stringWithFormat: @"The socket of type %@ is already connected or bound and thus " - @"can't be connected or bound again!", _inClass]; + @"can't be connected or bound again!", [_socket class]]; } - (OFTCPSocket*)socket { OF_GETTER(_socket, false) } @end