ObjFW
Classes | Typedefs
OFDatagramSocket.h File Reference
#import "OFObject.h"
#import "OFKernelEventObserver.h"
#import "OFRunLoop.h"
#import "socket.h"
Include dependency graph for OFDatagramSocket.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

protocol  <OFDatagramSocketDelegate>
 A delegate for OFDatagramSocket. More...
 
class  OFDatagramSocket
 A base class for datagram sockets. More...
 

Typedefs

typedef bool(^ of_datagram_socket_async_receive_block_t) (size_t length, const of_socket_address_t *_Nonnull sender, id _Nullable exception)
 A block which is called when a packet has been received. More...
 
typedef OFData *_Nullable(^ of_datagram_socket_async_send_data_block_t) (OFData *_Nonnull data, const of_socket_address_t *_Nonnull receiver, id _Nullable exception)
 A block which is called when a packet has been sent. More...
 

Typedef Documentation

◆ of_datagram_socket_async_receive_block_t

typedef bool(^ of_datagram_socket_async_receive_block_t) (size_t length, const of_socket_address_t *_Nonnull sender, id _Nullable exception)

A block which is called when a packet has been received.

Parameters
lengthThe length of the packet
senderThe address of the sender of the packet
exceptionAn exception which occurred while receiving or nil on success
Returns
A bool whether the same block should be used for the next receive

◆ of_datagram_socket_async_send_data_block_t

typedef OFData* _Nullable(^ of_datagram_socket_async_send_data_block_t) (OFData *_Nonnull data, const of_socket_address_t *_Nonnull receiver, id _Nullable exception)

A block which is called when a packet has been sent.

Parameters
dataThe data which was sent
receiverThe receiver for the packet
exceptionAn exception which occurred while reading or nil on success
Returns
The data to repeat the send with or nil if it should not repeat