ObjFW
Classes | Typedefs
OFDatagramSocket.h File Reference
#import "OFObject.h"
#import "OFKernelEventObserver.h"
#import "OFRunLoop.h"
#import "OFSocket.h"

Go to the source code of this file.

Classes

class  OFDatagramSocket
 A base class for datagram sockets. More...
 

Typedefs

typedef bool(^ OFDatagramSocketAsyncReceiveBlock) (size_t length, const OFSocketAddress *sender, id exception)
 A block which is called when a packet has been received. More...
 
typedef 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. More...
 
typedef OFData *(^ OFDatagramSocketAsyncSendDataBlock) (id exception)
 A block which is called when a packet has been sent. More...
 
typedef OFData *(^ OFDatagramSocketDataSentHandler) (OFDatagramSocket *socket, OFData *data, const OFSocketAddress *receiver, id exception)
 A handler which is called when a packet has been sent. More...
 

Typedef Documentation

◆ OFDatagramSocketAsyncReceiveBlock

typedef bool(^ OFDatagramSocketAsyncReceiveBlock) (size_t length, const OFSocketAddress *sender, id exception)

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

Deprecated:
Use OFDatagramSocketPacketReceivedHandler instead.
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

◆ OFDatagramSocketAsyncSendDataBlock

typedef OFData*(^ OFDatagramSocketAsyncSendDataBlock) (id exception)

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

Deprecated:
Use OFDatagramSocketDataSentHandler instead.
Parameters
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

◆ OFDatagramSocketDataSentHandler

typedef OFData*(^ OFDatagramSocketDataSentHandler) (OFDatagramSocket *socket, OFData *data, const OFSocketAddress *receiver, id exception)

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

Parameters
socketThe datagram socket which sent a packet
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

◆ OFDatagramSocketPacketReceivedHandler

typedef 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.

Parameters
socketThe socket that received a packet
bufferThe buffer the packet was stored in
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 handler should be used for the next receive