14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
* file.
*/
#include "config.h"
#import "OFAcceptFailedException.h"
#import "OFString.h"
#import "OFTCPSocket.h"
#import "common.h"
#import "macros.h"
@implementation OFAcceptFailedException
+ (instancetype)exceptionWithSocket: (OFTCPSocket*)socket
{
return [[[self alloc] initWithSocket: socket] autorelease];
}
- init
{
OF_INVALID_INIT_METHOD
}
- initWithSocket: (OFTCPSocket*)socket
{
self = [super init];
_socket = [socket retain];
_errNo = GET_SOCK_ERRNO;
return self;
|
<
|
|
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
* file.
*/
#include "config.h"
#import "OFAcceptFailedException.h"
#import "OFString.h"
#import "common.h"
#import "macros.h"
@implementation OFAcceptFailedException
+ (instancetype)exceptionWithSocket: (id)socket
{
return [[[self alloc] initWithSocket: socket] autorelease];
}
- init
{
OF_INVALID_INIT_METHOD
}
- initWithSocket: (id)socket
{
self = [super init];
_socket = [socket retain];
_errNo = GET_SOCK_ERRNO;
return self;
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
- (OFString*)description
{
return [OFString stringWithFormat:
@"Failed to accept connection in socket of class %@! " ERRFMT,
[_socket class], ERRPARAM];
}
- (OFTCPSocket*)socket
{
OF_GETTER(_socket, true)
}
- (int)errNo
{
#ifdef _WIN32
return of_wsaerr_to_errno(_errNo);
#else
return _errNo;
#endif
}
@end
|
|
|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
- (OFString*)description
{
return [OFString stringWithFormat:
@"Failed to accept connection in socket of class %@! " ERRFMT,
[_socket class], ERRPARAM];
}
- (id)socket
{
OF_GETTER(_socket, true)
}
- (int)errNo
{
#ifdef _WIN32
return of_wsaerr_to_errno(_errNo);
#else
return _errNo;
#endif
}
@end
|