21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
#import "OFNotImplementedException.h"
#import "common.h"
@implementation OFBindFailedException
+ newWithClass: (Class)class_
host: (OFString*)host
port: (uint16_t)port
{
return [[self alloc] initWithClass: class_
host: host
port: port];
}
- initWithClass: (Class)class_
{
Class c = isa;
[self release];
@throw [OFNotImplementedException newWithClass: c
selector: _cmd];
}
- initWithClass: (Class)class_
host: (OFString*)host_
port: (uint16_t)port_
{
self = [super initWithClass: class_];
@try {
host = [host_ copy];
port = port_;
errNo = GET_SOCK_ERRNO;
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
[host release];
[super dealloc];
}
- (OFString*)description
{
if (description != nil)
return description;
description = [[OFString alloc] initWithFormat:
@"Binding to port %" @PRIu16 @" on host %@ failed in class %@! "
ERRFMT, port, host, inClass, ERRPARAM];
return description;
}
- (int)errNo
{
return errNo;
}
- (OFString*)host
{
return host;
}
- (uint16_t)port
{
return port;
}
@end
|
>
>
>
>
|
|
|
>
|
|
>
>
>
>
>
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
#import "OFNotImplementedException.h"
#import "common.h"
@implementation OFBindFailedException
+ newWithClass: (Class)class_
socket: (OFTCPSocket*)socket
host: (OFString*)host
port: (uint16_t)port
{
return [[self alloc] initWithClass: class_
socket: socket
host: host
port: port];
}
- initWithClass: (Class)class_
{
Class c = isa;
[self release];
@throw [OFNotImplementedException newWithClass: c
selector: _cmd];
}
- initWithClass: (Class)class_
socket: (OFTCPSocket*)socket_
host: (OFString*)host_
port: (uint16_t)port_
{
self = [super initWithClass: class_];
@try {
socket = [socket_ retain];
host = [host_ copy];
port = port_;
errNo = GET_SOCK_ERRNO;
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
- (void)dealloc
{
[socket release];
[host release];
[super dealloc];
}
- (OFString*)description
{
if (description != nil)
return description;
description = [[OFString alloc] initWithFormat:
@"Binding to port %" @PRIu16 @" on host %@ failed in class %@! "
ERRFMT, port, host, inClass, ERRPARAM];
return description;
}
- (OFTCPSocket*)socket
{
return socket;
}
- (OFString*)host
{
return host;
}
- (uint16_t)port
{
return port;
}
- (int)errNo
{
return errNo;
}
@end
|