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
|
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
|
+
+
+
+
+
|
* than one thread at the same time is not thread-safe, even if copy
* was called to create one "instance" for every thread!
*/
@interface OFSequencedPacketSocket: OFObject <OFCopying,
OFReadyForReadingObserving, OFReadyForWritingObserving>
{
OFSocketHandle _socket;
#ifdef OF_AMIGAOS
LONG _socketID; /* unused, reserved for ABI stability */
int _family; /* unused, reserved for ABI stability */
#endif
bool _canBlock, _listening;
OFSocketAddress _remoteAddress;
id _Nullable _delegate;
OF_RESERVE_IVARS(OFSequencedPacketSocket, 4)
}
/**
* @brief Whether the socket can block.
*
* By default, a socket can block.
*
* @throw OFGetOptionFailedException The option could not be retrieved
* @throw OFSetOptionFailedException The option could not be set
*/
@property (nonatomic) bool canBlock;
/**
* @brief Whether the socket is a listening socket.
*/
|
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
#endif
/**
* @brief Cancels all pending asynchronous requests on the socket.
*/
- (void)cancelAsyncRequests;
/**
* @brief Releases the socket from the current thread.
*
* This is necessary on some platforms in order to allow a different thread to
* use the socket, e.g. on AmigaOS, but you should call it on all operating
* systems before using the socket from a different thread.
*
* After calling this method, you must no longer use the socket until
* @ref obtainSocketForCurrentThread has been called.
*/
- (void)releaseSocketFromCurrentThread;
/**
* @brief Obtains the socket for the current thread.
*
* This is necessary on some platforms in order to allow a different thread to
* use the socket, e.g. on AmigaOS, but you should call it on all operating
* systems before using the socket from a different thread.
*
* You must only call this method after @ref releaseSocketFromCurrentThread has
* been called from a different thread.
*/
- (void)obtainSocketForCurrentThread;
/**
* @brief Closes the socket so that it can neither receive nor send any more
* datagrams.
*
* @throw OFNotOpenException The socket is not open
*/
- (void)close;
@end
OF_ASSUME_NONNULL_END
|