Differences From Artifact [abbf9520ca]:
- File
src/OFStreamObserver.h
— part of check-in
[35aab77af3]
at
2011-04-01 16:54:57
on branch trunk
— Make OFStreamObserver thread-safe.
It does not cancel the currently running -[observe] yet when changing
the set of streams to observe. (user: js, size: 4106) [annotate] [blame] [check-ins using]
To Artifact [7b1f8623a5]:
- File
src/OFStreamObserver.h
— part of check-in
[a61ab37726]
at
2011-04-01 22:14:32
on branch trunk
— Cancel the currently blocking -[observe] when the stream set is changed.
Not working on win32 yet, it will be ported to it later as it's not that
easy there, since select() can only observe sockets. (user: js, size: 4739) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | OFMutableDictionary *fdToStream; #else fd_set readfds; fd_set writefds; fd_set exceptfds; int nfds; #endif } #ifdef OF_HAVE_PROPERTIES @property (retain) id <OFStreamObserverDelegate> delegate; #endif /** | > | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | OFMutableDictionary *fdToStream; #else fd_set readfds; fd_set writefds; fd_set exceptfds; int nfds; #endif int cancelFd[2]; } #ifdef OF_HAVE_PROPERTIES @property (retain) id <OFStreamObserverDelegate> delegate; #endif /** |
︙ | ︙ | |||
109 110 111 112 113 114 115 | * * \param delegate The delegate for the OFStreamObserver */ - (void)setDelegate: (id <OFStreamObserverDelegate>)delegate; /** * Adds a stream to observe for reading. | | > > > > > > > > > > > > | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | * * \param delegate The delegate for the OFStreamObserver */ - (void)setDelegate: (id <OFStreamObserverDelegate>)delegate; /** * Adds a stream to observe for reading. * * This is also used to observe a listening socket for incoming connections, * which then triggers a read event for the observed stream. * * It is recommended that the stream you add is set to non-blocking mode. * * If there is an -[observe] call blocking, it will be canceled. The reason for * this is to prevent blocking even though the new added stream is ready. * * \param stream The stream to observe for reading */ - (void)addStreamToObserveForReading: (OFStream*)stream; /** * Adds a stream to observe for writing. * * It is recommended that the stream you add is set to non-blocking mode. * * If there is an -[observe] call blocking, it will be canceled. The reason for * this is to prevent blocking even though the new added stream is ready. * * \param stream The stream to observe for writing */ - (void)addStreamToObserveForWriting: (OFStream*)stream; /** * Removes a stream to observe for reading. * * If there is an -[observe] call blocking, it will be canceled. The reason for * this is to prevent the removed stream from still being observed. * * \param stream The stream to remove from observing for reading */ - (void)removeStreamToObserveForReading: (OFStream*)stream; /** * Removes a stream to observe for writing. * * If there is an -[observe] call blocking, it will be canceled. The reason for * this is to prevent the removed stream from still being observed. * * \param stream The stream to remove from observing for writing */ - (void)removeStreamToObserveForWriting: (OFStream*)stream; /** * Observes all streams and blocks until an event happens on a stream. |
︙ | ︙ |