21#import "OFKernelEventObserver.h"
25OF_ASSUME_NONNULL_BEGIN
46 OF_DEPRECATED(ObjFW, 1, 2,
47 "Use OFDatagramSocketPacketReceivedHandler instead");
62 id _Nullable exception);
74 id _Nullable exception)
75 OF_DEPRECATED(ObjFW, 1, 2,
76 "Use OFDatagramSocketDataSentHandler instead");
112 didReceiveIntoBuffer: (
void *)buffer
113 length: (
size_t)length
115 exception: (nullable
id)exception;
127 didSendData: (
OFData *)data
129 exception: (nullable
id)exception;
147 OFSocketHandle _socket;
154 bool _canSendToBroadcastAddresses;
156 id <OFDatagramSocketDelegate> _Nullable _delegate;
168@property (nonatomic)
bool canBlock;
176@property (nonatomic)
bool canSendToBroadcastAddresses;
184@property OF_NULLABLE_PROPERTY (assign, nonatomic)
185 id <OFDatagramSocketDelegate> delegate;
192+ (instancetype)socket;
207- (size_t)receiveIntoBuffer: (
void *)buffer
208 length: (
size_t)length
220- (void)asyncReceiveIntoBuffer: (
void *)buffer length: (
size_t)length;
233- (void)asyncReceiveIntoBuffer: (
void *)buffer
234 length: (
size_t)length
255- (void)asyncReceiveIntoBuffer: (
void *)buffer
256 length: (
size_t)length
258 OF_DEPRECATED(ObjFW, 1, 2,
259 "Use -[asyncReceiveIntoBuffer:length:handler:] instead");
276- (void)asyncReceiveIntoBuffer: (
void *)buffer
277 length: (
size_t)length
300- (void)asyncReceiveIntoBuffer: (
void *)buffer
301 length: (
size_t)length
304 OF_DEPRECATED(ObjFW, 1, 2,
305 "Use -[asyncReceiveIntoBuffer:length:runLoopMode:handler:] instead");
324- (void)asyncReceiveIntoBuffer: (
void *)buffer
325 length: (
size_t)length
340- (void)sendBuffer: (const
void *)buffer
341 length: (
size_t)length
351- (void)asyncSendData: (
OFData *)data
363- (void)asyncSendData: (
OFData *)data
380- (void)asyncSendData: (
OFData *)data
383 OF_DEPRECATED(ObjFW, 1, 2,
384 "Use -[asyncSendData:receiver:handler:] instead");
396- (void)asyncSendData: (
OFData *)data
414- (void)asyncSendData: (
OFData *)data
418 OF_DEPRECATED(ObjFW, 1, 2,
419 "Use -[asyncSendData:receiver:runLoopMode:handler:] instead");
433- (void)asyncSendData: (
OFData *)data
449- (void)releaseSocketFromCurrentThread;
461- (void)obtainSocketForCurrentThread;
466- (void)cancelAsyncRequests;
bool(^ OFDatagramSocketPacketReceivedHandler)(OFDatagramSocket *socket, void *buffer, size_t length, const OFSocketAddress *sender, id exception)
A handler which is called when a packet has been received.
Definition OFDatagramSocket.h:60
OFData *(^ OFDatagramSocketAsyncSendDataBlock)(id exception)
A block which is called when a packet has been sent.
Definition OFDatagramSocket.h:73
bool(^ OFDatagramSocketAsyncReceiveBlock)(size_t length, const OFSocketAddress *sender, id exception)
A block which is called when a packet has been received.
Definition OFDatagramSocket.h:44
OFData *(^ OFDatagramSocketDataSentHandler)(OFDatagramSocket *socket, OFData *data, const OFSocketAddress *receiver, id exception)
A handler which is called when a packet has been sent.
Definition OFDatagramSocket.h:88
A class for storing constant strings using the @"" literal.
Definition OFConstantString.h:42
A class for storing arbitrary data in an array.
Definition OFData.h:46
A base class for datagram sockets.
Definition OFDatagramSocket.h:147
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A protocol for the creation of copies.
Definition OFObject.h:1350
This protocol is implemented by classes which can be observed for readiness for reading by OFKernelEv...
Definition OFKernelEventObserver.h:83
This protocol is implemented by classes which can be observed for readiness for writing by OFKernelEv...
Definition OFKernelEventObserver.h:97
A struct which represents a host / port pair for a socket.
Definition OFSocket.h:189