21 #import "OFKernelEventObserver.h" 25 OF_ASSUME_NONNULL_BEGIN
44 id _Nullable exception)
45 OF_DEPRECATED(ObjFW, 1, 2,
46 "Use OFSequencedPacketSocketPacketReceivedHandler instead");
60 id _Nullable exception);
72 id _Nullable exception)
73 OF_DEPRECATED(ObjFW, 1, 2,
74 "Use OFSequencedPacketSocketDataSentHandler instead");
101 OF_DEPRECATED(ObjFW, 1, 2,
102 "Use OFSequencedPacketSocketAcceptedHandler instead");
116 id _Nullable exception);
138 didReceiveIntoBuffer: (
void *)buffer
139 length: (
size_t)length
140 exception: (nullable
id)exception;
151 didSendData: (
OFData *)data
152 exception: (nullable
id)exception;
165 exception: (nullable
id)exception;
184 OFSocketHandle _socket;
189 bool _canBlock, _listening;
191 id _Nullable _delegate;
203 @property (nonatomic)
bool canBlock;
208 @property (readonly, nonatomic, getter=isListening)
bool listening;
226 @property OF_NULLABLE_PROPERTY (assign, nonatomic)
227 id <OFSequencedPacketSocketDelegate> delegate;
234 + (instancetype)socket;
247 - (size_t)receiveIntoBuffer: (
void *)buffer length: (
size_t)length;
258 - (void)asyncReceiveIntoBuffer: (
void *)buffer length: (
size_t)length;
271 - (void)asyncReceiveIntoBuffer: (
void *)buffer
272 length: (
size_t)length
275 #ifdef OF_HAVE_BLOCKS 292 - (void)asyncReceiveIntoBuffer: (
void *)buffer
293 length: (
size_t)length
295 OF_DEPRECATED(ObjFW, 1, 2,
296 "Use -[asyncReceiveIntoBuffer:length:handler:] instead");
313 - (void)asyncReceiveIntoBuffer: (
void *)buffer
314 length: (
size_t)length
337 - (void)asyncReceiveIntoBuffer: (
void *)buffer
338 length: (
size_t)length
341 OF_DEPRECATED(ObjFW, 1, 2,
342 "Use -[asyncReceiveIntoBuffer:length:runLoopMode:handler:] instead");
361 - (void)asyncReceiveIntoBuffer: (
void *)buffer
362 length: (
size_t)length
376 - (void)sendBuffer: (const
void *)buffer length: (
size_t)length;
383 - (void)asyncSendData: (
OFData *)data;
394 #ifdef OF_HAVE_BLOCKS 405 - (void)asyncSendData: (
OFData *)data
407 OF_DEPRECATED(ObjFW, 1, 2, "Use -[asyncSendData:handler:] instead");
417 - (void)asyncSendData: (
OFData *)data
432 - (void)asyncSendData: (
OFData *)data
435 OF_DEPRECATED(ObjFW, 1, 2,
436 "Use -[asyncSendData:runLoopMode:handler:] instead");
448 - (void)asyncSendData: (
OFData *)data
460 - (void)listenWithBacklog: (
int)backlog;
477 - (instancetype)accept;
490 - (void)asyncAcceptWithRunLoopMode: (
OFRunLoopMode)runLoopMode;
492 #ifdef OF_HAVE_BLOCKS 503 OF_DEPRECATED(ObjFW, 1, 2, "Use -[asyncAcceptWithHandler:] instead");
528 OF_DEPRECATED(ObjFW, 1, 2,
529 "Use -[asyncAcceptWithRunLoopMode:handler:] instead");
548 - (void)cancelAsyncRequests;
560 - (void)releaseSocketFromCurrentThread;
572 - (void)obtainSocketForCurrentThread;
583 OF_ASSUME_NONNULL_END
bool(^ OFSequencedPacketSocketPacketReceivedHandler)(OFSequencedPacketSocket *socket, void *buffer, size_t length, id exception)
A handler which is called when a packet has been received.
Definition: OFSequencedPacketSocket.h:58
This protocol is implemented by classes which can be observed for readiness for reading by OFKernelEv...
OFData *(^ OFSequencedPacketSocketDataSentHandler)(OFSequencedPacketSocket *socket, OFData *data, id exception)
A handler which is called when a packet has been sent.
Definition: OFSequencedPacketSocket.h:85
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:41
The root class for all other classes inside ObjFW.
Definition: OFObject.h:690
OFData *(^ OFSequencedPacketSocketAsyncSendDataBlock)(id exception)
A block which is called when a packet has been sent.
Definition: OFSequencedPacketSocket.h:71
A struct which represents a host / port pair for a socket.
Definition: OFSocket.h:189
instancetype socket()
Returns a new, autoreleased OFSequencedPacketSocket.
Definition: OFSequencedPacketSocket.m:54
This protocol is implemented by classes which can be observed for readiness for writing by OFKernelEv...
A protocol for the creation of copies.
Definition: OFObject.h:1350
bool(^ OFSequencedPacketSocketAsyncReceiveBlock)(size_t length, id exception)
A block which is called when a packet has been received.
Definition: OFSequencedPacketSocket.h:43
A class for storing arbitrary data in an array.
Definition: OFData.h:45
A base class for sequenced packet sockets.
Definition: OFSequencedPacketSocket.h:181
A delegate for OFSequencedPacketSocket.
bool(^ OFSequencedPacketSocketAcceptedHandler)(OFSequencedPacketSocket *socket, OFSequencedPacketSocket *acceptedSocket, id exception)
A handler which is called when the socket accepted a connection.
Definition: OFSequencedPacketSocket.h:114
bool(^ OFSequencedPacketSocketAsyncAcceptBlock)(OFSequencedPacketSocket *acceptedSocket, id exception)
A block which is called when the socket accepted a connection.
Definition: OFSequencedPacketSocket.h:99