ObjFW  Diff

Differences From Artifact [f4eafbf792]:

To Artifact [3d03b149bd]:


8
9
10
11
12
13
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
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

@class OFSocket;

@class OFDataArray;
@class OFMutableDictionary;

/**
 * \brief A protocol that needs to be implemented by delegates for
 *	  OFSocketObserver.
 */
@protocol OFSocketObserverDelegate








/**
 * This callback is called when a socket did get ready for reading.
 *
 * This callback is also called when a listening socket got a new incoming
 * connection.
 *
 * \param sock The socket which did get ready for reading
 */
- (void)socketDidGetReadyForReading: (OFSocket*)sock;

/**
 * This callback is called when a socket did get ready for writing.
 *
 * \param sock The socket which did get ready for writing
 */
- (void)socketDidGetReadyForWriting: (OFSocket*)sock;
@end

/**
 * \brief A class that can observe multiple sockets at once.
 */
@interface OFSocketObserver: OFObject
{







>








>
>
>
>
>
>
>
>



<
<
<
|

|




|

|







8
9
10
11
12
13
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
51
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"

@class OFSocket;
@class OFTCPSocket;
@class OFDataArray;
@class OFMutableDictionary;

/**
 * \brief A protocol that needs to be implemented by delegates for
 *	  OFSocketObserver.
 */
@protocol OFSocketObserverDelegate
/*
 * This callback is called when a listening socket got a new incoming
 * connection.
 *
 * \param sock The socket which did receive an incoming connection
 */
- (void)socketDidReceiveIncomingConnection: (OFTCPSocket*)sock;

/**
 * This callback is called when a socket did get ready for reading.
 *



 * \param sock The socket which did become ready for reading
 */
- (void)socketDidBecomeReadyForReading: (OFSocket*)sock;

/**
 * This callback is called when a socket did get ready for writing.
 *
 * \param sock The socket which did become ready for writing
 */
- (void)socketDidBecomeReadyForWriting: (OFSocket*)sock;
@end

/**
 * \brief A class that can observe multiple sockets at once.
 */
@interface OFSocketObserver: OFObject
{
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
/**
 * Sets the delegate for the OFSocketObserver.
 *
 * \param delegate The delegate for the OFSocketObserver
 */
- (void)setDelegate: (OFObject <OFSocketObserverDelegate>*)delegate;








/**
 * Adds a socket to observe for reading.
 *
 * \param sock The socket to observe for reading
 */
- (void)addSocketToObserveForReading: (OFSocket*)sock;

/**
 * Adds a socket to observe for writing.
 *
 * \param sock The socket to observe for writing
 */
- (void)addSocketToObserveForWriting: (OFSocket*)sock;








/**
 * Removes a socket to observe for reading.
 *
 * \param sock The socket to remove from observing for reading
 */
- (void)removeSocketToObserveForReading: (OFSocket*)sock;








>
>
>
>
>
>
>














>
>
>
>
>
>
>







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
106
107
108
109
110
111
112
/**
 * Sets the delegate for the OFSocketObserver.
 *
 * \param delegate The delegate for the OFSocketObserver
 */
- (void)setDelegate: (OFObject <OFSocketObserverDelegate>*)delegate;

/**
 * Adds a socket to observe for incoming connections.
 *
 * \param sock The socket to observe for incoming connections
 */
- (void)addSocketToObserveForIncomingConnections: (OFTCPSocket*)sock;

/**
 * Adds a socket to observe for reading.
 *
 * \param sock The socket to observe for reading
 */
- (void)addSocketToObserveForReading: (OFSocket*)sock;

/**
 * Adds a socket to observe for writing.
 *
 * \param sock The socket to observe for writing
 */
- (void)addSocketToObserveForWriting: (OFSocket*)sock;

/**
 * Removes a socket to observe for incoming connections.
 *
 * \param sock The socket to remove from observing for incoming connections
 */
- (void)removeSocketToObserveForIncomingConnections: (OFTCPSocket*)sock;

/**
 * Removes a socket to observe for reading.
 *
 * \param sock The socket to remove from observing for reading
 */
- (void)removeSocketToObserveForReading: (OFSocket*)sock;