ObjFW  Diff

Differences From Artifact [923c073c02]:

To Artifact [70764cc054]:


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
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#if !defined(OF_HAVE_POLL) && defined(OF_HAVE_SYS_SELECT_H)
# include <sys/select.h>
#endif

#import "OFObject.h"

#ifdef _WIN32
# ifndef _WIN32_WINNT
#  define _WIN32_WINNT 0x0501
# endif
# include <windows.h>
# include <ws2tcpip.h>
#endif

@class OFStream;
#ifdef OF_HAVE_POLL
@class OFDataArray;
#endif
@class OFMutableArray;
@class OFMutableDictionary;

/**
 * \brief A protocol that needs to be implemented by delegates for
 *	  OFStreamObserver.
 */







<
<
<
<











<
<
<







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
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */





#import "OFObject.h"

#ifdef _WIN32
# ifndef _WIN32_WINNT
#  define _WIN32_WINNT 0x0501
# endif
# include <windows.h>
# include <ws2tcpip.h>
#endif

@class OFStream;



@class OFMutableArray;
@class OFMutableDictionary;

/**
 * \brief A protocol that needs to be implemented by delegates for
 *	  OFStreamObserver.
 */
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 */
@interface OFStreamObserver: OFObject
{
	OFMutableArray *readStreams;
	OFMutableArray *writeStreams;
	OFMutableArray *queue, *queueInfo;
	id <OFStreamObserverDelegate> delegate;
#ifdef OF_HAVE_POLL
	OFDataArray *FDs;
	OFMutableDictionary *FDToStream;
#else
	fd_set readFDs;
	fd_set writeFDs;
	fd_set exceptFDs;
	int nFDs;
#endif
	int cancelFD[2];
#ifdef _WIN32
	struct sockaddr_in cancelAddr;
#endif
}

#ifdef OF_HAVE_PROPERTIES







<
<
<
<
<
<
<
<
<







69
70
71
72
73
74
75









76
77
78
79
80
81
82
 */
@interface OFStreamObserver: OFObject
{
	OFMutableArray *readStreams;
	OFMutableArray *writeStreams;
	OFMutableArray *queue, *queueInfo;
	id <OFStreamObserverDelegate> delegate;









	int cancelFD[2];
#ifdef _WIN32
	struct sockaddr_in cancelAddr;
#endif
}

#ifdef OF_HAVE_PROPERTIES
172
173
174
175
176
177
178




179
180
181
182
 * Observes all streams until an event happens on a stream or the timeout is
 * reached.
 *
 * \param timeout The time to wait for an event, in milliseconds
 * \return A boolean whether events occurred during the timeinterval
 */
- (BOOL)observeWithTimeout: (int)timeout;




@end

@interface OFObject (OFStreamObserverDelegate) <OFStreamObserverDelegate>
@end







>
>
>
>




156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
 * Observes all streams until an event happens on a stream or the timeout is
 * reached.
 *
 * \param timeout The time to wait for an event, in milliseconds
 * \return A boolean whether events occurred during the timeinterval
 */
- (BOOL)observeWithTimeout: (int)timeout;

/// \cond internal
- (BOOL)_processCache;
/// \endcond
@end

@interface OFObject (OFStreamObserverDelegate) <OFStreamObserverDelegate>
@end