ObjFW
Loading...
Searching...
No Matches
OFSequencedPacketSocket.h File Reference
import "OFObject.h"
import "OFKernelEventObserver.h"
import "OFRunLoop.h"
import "OFSocket.h"

Go to the source code of this file.

Classes

protocol  <OFSequencedPacketSocketDelegate>
 A delegate for OFSequencedPacketSocket. More...
 
class  OFSequencedPacketSocket
 A base class for sequenced packet sockets. More...
 

Typedefs

typedef bool(^ OFSequencedPacketSocketAsyncReceiveBlock) (size_t length, id exception)
 A block which is called when a packet has been received.
 
typedef bool(^ OFSequencedPacketSocketPacketReceivedHandler) (OFSequencedPacketSocket *socket, void *buffer, size_t length, id exception)
 A handler which is called when a packet has been received.
 
typedef OFData *(^ OFSequencedPacketSocketAsyncSendDataBlock) (id exception)
 A block which is called when a packet has been sent.
 
typedef OFData *(^ OFSequencedPacketSocketDataSentHandler) (OFSequencedPacketSocket *socket, OFData *data, id exception)
 A handler which is called when a packet has been sent.
 
typedef bool(^ OFSequencedPacketSocketAsyncAcceptBlock) (OFSequencedPacketSocket *acceptedSocket, id exception)
 A block which is called when the socket accepted a connection.
 
typedef bool(^ OFSequencedPacketSocketAcceptedHandler) (OFSequencedPacketSocket *socket, OFSequencedPacketSocket *acceptedSocket, id exception)
 A handler which is called when the socket accepted a connection.
 

Typedef Documentation

◆ OFSequencedPacketSocketAcceptedHandler

typedef bool(^ OFSequencedPacketSocketAcceptedHandler) (OFSequencedPacketSocket *socket, OFSequencedPacketSocket *acceptedSocket, id exception)

A handler which is called when the socket accepted a connection.

Parameters
socketThe socket which accepted the connection
acceptedSocketThe socket which has been accepted
exceptionAn exception which occurred while accepting the socket or nil on success
Returns
A bool whether the same handler should be used for the next incoming connection

◆ OFSequencedPacketSocketAsyncAcceptBlock

typedef bool(^ OFSequencedPacketSocketAsyncAcceptBlock) (OFSequencedPacketSocket *acceptedSocket, id exception)

A block which is called when the socket accepted a connection.

Deprecated
Use OFSequencedPacketSocketAcceptedHandler instead.
Parameters
acceptedSocketThe socket which has been accepted
exceptionAn exception which occurred while accepting the socket or nil on success
Returns
A bool whether the same block should be used for the next incoming connection

◆ OFSequencedPacketSocketAsyncReceiveBlock

typedef bool(^ OFSequencedPacketSocketAsyncReceiveBlock) (size_t length, id exception)

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

Deprecated
Use OFSequencedPacketSocketPacketReceivedHandler instead.
Parameters
lengthThe length 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

◆ OFSequencedPacketSocketAsyncSendDataBlock

typedef OFData *(^ OFSequencedPacketSocketAsyncSendDataBlock) (id exception)

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

Deprecated
Use OFSequencedPacketSocketDataSentHandler 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

◆ OFSequencedPacketSocketDataSentHandler

typedef OFData *(^ OFSequencedPacketSocketDataSentHandler) (OFSequencedPacketSocket *socket, OFData *data, id exception)

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

Parameters
socketThe sequenced packet socket which sent a packet
dataThe data which was sent
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

◆ OFSequencedPacketSocketPacketReceivedHandler

typedef bool(^ OFSequencedPacketSocketPacketReceivedHandler) (OFSequencedPacketSocket *socket, void *buffer, size_t length, id exception)

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

Parameters
socketThe sequenced packet socket which received a packet
bufferThe buffer the packet has been written to
lengthThe length 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