Overview
Context
Changes
Modified src/exceptions/OFAcceptFailedException.h
from [5433a5f6c5]
to [8f1c5ce95c].
︙ | | |
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
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
|
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
-
-
-
+
-
+
-
+
-
+
-
+
|
#import "OFException.h"
#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
|
Modified src/exceptions/OFAcceptFailedException.m
from [fed21c88a0]
to [36ac9f1562].
︙ | | |
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
|
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 "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;
return self;
|
︙ | | |
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
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];
}
- (OFTCPSocket*)socket
- (id)socket
{
OF_GETTER(_socket, true)
}
- (int)errNo
{
#ifdef _WIN32
return of_wsaerr_to_errno(_errNo);
#else
return _errNo;
#endif
}
@end
|
Modified src/exceptions/OFAlreadyConnectedException.h
from [dd3d7a6071]
to [d71c747bb3].
︙ | | |
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
-
-
-
+
-
+
-
+
-
+
-
+
|
#import "OFException.h"
#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
|
Modified src/exceptions/OFAlreadyConnectedException.m
from [127aad522e]
to [f384be7749].
︙ | | |
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
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-
-
+
-
+
|
* file.
*/
#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];
return self;
}
|
︙ | | |
51
52
53
54
55
56
57
58
59
60
61
62
|
50
51
52
53
54
55
56
57
58
59
60
61
|
-
+
|
@"The socket of type %@ is already connected or bound and "
@"thus can't be connected or bound again!",
[_socket class]];
else
return @"A connection has already been established!";
}
- (OFTCPSocket*)socket
- (id)socket
{
OF_GETTER(_socket, true)
}
@end
|
Modified src/exceptions/OFConnectionFailedException.h
from [d46ff45148]
to [dfacad7397].
︙ | | |
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
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
|
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
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
|
-
-
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
|
#import "OFException.h"
#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
/*!
* @brief Creates a new, autoreleased connection failed exception.
*
* @param host The host to which the connection failed
* @param port The port on the host to which the connection failed
* @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
* @param port The port on the host to which the connection failed
* @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
*/
- (OFString*)host;
|
︙ | | |
Modified src/exceptions/OFConnectionFailedException.m
from [2e9f453e47]
to [9a3aa0b1c9].
︙ | | |
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
45
46
47
48
49
50
|
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
45
46
47
48
49
|
-
-
+
-
+
|
* file.
*/
#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];
}
- init
{
OF_INVALID_INIT_METHOD
}
- initWithHost: (OFString*)host
port: (uint16_t)port
socket: (OFTCPSocket*)socket
socket: (id)socket
{
self = [super init];
@try {
_host = [host copy];
_socket = [socket retain];
_port = port;
|
︙ | | |
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
-
+
|
}
- (uint16_t)port
{
return _port;
}
- (OFTCPSocket*)socket
- (id)socket
{
OF_GETTER(_socket, true)
}
- (int)errNo
{
#ifdef _WIN32
return of_wsaerr_to_errno(_errNo);
#else
return _errNo;
#endif
}
@end
|