@@ -1357,16 +1357,14 @@ } @end @implementation OFAddressTranslationFailedException + newWithClass: (Class)class_ - node: (OFString*)node - service: (OFString*)service + host: (OFString*)host { return [[self alloc] initWithClass: class_ - node: node - service: service]; + host: host]; } - initWithClass: (Class)class_ { self = [super initWithClass: class_]; @@ -1375,19 +1373,17 @@ return self; } - initWithClass: (Class)class_ - node: (OFString*)node_ - service: (OFString*)service_ + host: (OFString*)host_ { self = [super initWithClass: class_]; @try { - node = [node_ copy]; - service = [service_ copy]; - errNo = GET_AT_ERRNO; + host = [host_ copy]; + errNo = GET_AT_ERRNO; } @catch (id e) { [self release]; @throw e; } @@ -1394,30 +1390,28 @@ return self; } - (void)dealloc { - [node release]; - [service release]; + [host release]; [super dealloc]; } - (OFString*)description { if (description != nil) return description; - if (node != nil && service != nil) + if (host != nil) description = [[OFString alloc] initWithFormat: - @"The service %@ on %@ could not be translated to an " - @"address in class %s. This means that either the node was " - @"not found, there is no such service on the node, there " - @"was a problem with the name server, there was a problem " - @"with your network connection or you specified an invalid " - @"node or service. " ERRFMT, service, node, - class_getName(inClass), AT_ERRPARAM]; + @"The host %@ could not be translated to an address in " + @"class %s. This means that either the host was not found, " + @"there was a problem with the name server, there was a " + @"problem with your network connection or you specified an " + @"invalid host. " ERRFMT, host, class_getName(inClass), + AT_ERRPARAM]; else description = [[OFString alloc] initWithFormat: @"An address translation failed in class %s! " ERRFMT, class_getName(inClass), AT_ERRPARAM]; @@ -1427,29 +1421,24 @@ - (int)errNo { return errNo; } -- (OFString*)node -{ - return node; -} - -- (OFString*)service -{ - return service; +- (OFString*)host +{ + return host; } @end @implementation OFConnectionFailedException + newWithClass: (Class)class_ - node: (OFString*)node - service: (OFString*)service + host: (OFString*)host + port: (uint16_t)port { return [[self alloc] initWithClass: class_ - node: node - service: service]; + host: host + port: port]; } - initWithClass: (Class)class_ { Class c = isa; @@ -1457,19 +1446,19 @@ @throw [OFNotImplementedException newWithClass: c selector: _cmd]; } - initWithClass: (Class)class_ - node: (OFString*)node_ - service: (OFString*)service_ + host: (OFString*)host_ + port: (uint16_t)port_ { self = [super initWithClass: class_]; @try { - node = [node_ copy]; - service = [service_ copy]; - errNo = GET_SOCK_ERRNO; + host = [host_ copy]; + port = port_; + errNo = GET_SOCK_ERRNO; } @catch (id e) { [self release]; @throw e; } @@ -1476,12 +1465,11 @@ return self; } - (void)dealloc { - [node release]; - [service release]; + [host release]; [super dealloc]; } - (OFString*)description @@ -1488,12 +1476,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"A connection to service %@ on node %@ could not be established " - @"in class %s! " ERRFMT, service, node, class_getName(inClass), + @"A connection to %@ on port %" @PRIu16 @"could not be established " + @"in class %s! " ERRFMT, host, port, class_getName(inClass), ERRPARAM]; return description; } @@ -1500,29 +1488,29 @@ - (int)errNo { return errNo; } -- (OFString*)node +- (OFString*)host { - return node; + return host; } -- (OFString*)service +- (uint16_t)port { - return service; + return port; } @end @implementation OFBindFailedException + newWithClass: (Class)class_ - node: (OFString*)node - service: (OFString*)service + host: (OFString*)host + port: (uint16_t)port { return [[self alloc] initWithClass: class_ - node: node - service: service]; + host: host + port: port]; } - initWithClass: (Class)class_ { Class c = isa; @@ -1530,19 +1518,19 @@ @throw [OFNotImplementedException newWithClass: c selector: _cmd]; } - initWithClass: (Class)class_ - node: (OFString*)node_ - service: (OFString*)service_ + host: (OFString*)host_ + port: (uint16_t)port_ { self = [super initWithClass: class_]; @try { - node = [node_ copy]; - service = [service_ copy]; - errNo = GET_SOCK_ERRNO; + host = [host_ copy]; + port = port_; + errNo = GET_SOCK_ERRNO; } @catch (id e) { [self release]; @throw e; } @@ -1549,12 +1537,11 @@ return self; } - (void)dealloc { - [node release]; - [service release]; + [host release]; [super dealloc]; } - (OFString*)description @@ -1561,29 +1548,29 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Binding service %@ on node %@ failed in class %s! " ERRFMT, - service, node, class_getName(inClass), ERRPARAM]; + @"Binding to port %" @PRIu16 @" on host %@ failed in class %s! " + ERRFMT, port, host, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo { return errNo; } -- (OFString*)node +- (OFString*)host { - return node; + return host; } -- (OFString*)service +- (uint16_t)port { - return service; + return port; } @end @implementation OFListenFailedException + newWithClass: (Class)class_