18 #ifdef OF_HAVE_SOCKETS
24 OF_ASSUME_NONNULL_BEGIN
26 #ifdef OF_HAVE_SOCKETS
27 @protocol OFRunLoopConnectDelegate <
OFObject>
28 - (void)of_socketDidConnect: (
id)socket
29 exception: (nullable
id)exception;
30 - (
id)of_connectionFailedExceptionForErrNo: (
int)errNo;
36 + (void)of_setMainRunLoop: (
OFRunLoop *)runLoop;
37 #ifdef OF_HAVE_SOCKETS
40 buffer: (
void *)buffer
41 length: (
size_t)length
43 # ifdef OF_HAVE_BLOCKS
49 buffer: (
void *)buffer
50 exactLength: (
size_t)length
52 # ifdef OF_HAVE_BLOCKS
60 # ifdef OF_HAVE_BLOCKS
70 # ifdef OF_HAVE_BLOCKS
80 # ifdef OF_HAVE_BLOCKS
86 # if !defined(OF_WII) && !defined(OF_NINTENDO_3DS)
87 + (void)of_addAsyncConnectForSocket: (
id)socket
89 delegate: (
id <OFRunLoopConnectDelegate>)delegate;
91 + (void)of_addAsyncAcceptForSocket: (
id)socket
93 block: (nullable
id)block
94 delegate: (nullable
id)delegate;
96 buffer: (
void *)buffer
97 length: (
size_t)length
99 # ifdef OF_HAVE_BLOCKS
107 # ifdef OF_HAVE_BLOCKS
111 + (void)of_addAsyncReceiveForSequencedPacketSocket:
113 buffer: (
void *)buffer
114 length: (
size_t)length
116 # ifdef OF_HAVE_BLOCKS
120 + (void)of_addAsyncSendForSequencedPacketSocket:
124 # ifdef OF_HAVE_BLOCKS
128 + (void)of_cancelAsyncRequestsForObject: (
id)object
134 OF_ASSUME_NONNULL_END
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.
Definition: OFDatagramSocket.h:52
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.
Definition: OFDatagramSocket.h:39
OFData *_Nullable(^ of_sequenced_packet_socket_async_send_data_block_t)(OFData *_Nonnull data, id _Nullable exception)
A block which is called when a packet has been sent.
Definition: OFSequencedPacketSocket.h:49
bool(^ of_sequenced_packet_socket_async_receive_block_t)(size_t length, id _Nullable exception)
A block which is called when a packet has been received.
Definition: OFSequencedPacketSocket.h:38
OFData *_Nullable(^ of_stream_async_write_data_block_t)(OFData *_Nonnull data, size_t bytesWritten, id _Nullable exception)
A block which is called when data was written asynchronously to a stream.
Definition: OFStream.h:77
bool(^ of_stream_async_read_block_t)(size_t length, id _Nullable exception)
A block which is called when data was read asynchronously from a stream.
Definition: OFStream.h:49
OFString *_Nullable(^ of_stream_async_write_string_block_t)(OFString *_Nonnull string, size_t bytesWritten, id _Nullable exception)
A block which is called when a string was written asynchronously to a stream.
Definition: OFStream.h:92
bool(^ of_stream_async_read_line_block_t)(OFString *_Nullable line, id _Nullable exception)
A block which is called when a line was read asynchronously from a stream.
Definition: OFStream.h:62
of_string_encoding_t
The encoding of a string.
Definition: OFString.h:68
struct objc_object * id
A pointer to any object.
Definition: ObjFWRT.h:90
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:40
A base class for datagram sockets.
Definition: OFDatagramSocket.h:112
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
A class providing a run loop for the application and its processes.
Definition: OFRunLoop.h:62
A base class for sequenced packet sockets.
Definition: OFSequencedPacketSocket.h:130
A base class for different types of streams.
Definition: OFStream.h:191
A class for handling strings.
Definition: OFString.h:132
A class for creating and firing timers.
Definition: OFTimer.h:46
A delegate for OFDatagramSocket.
Definition: OFDatagramSocket.h:63
This protocol is implemented by classes which can be observed for readiness for reading by OFKernelEv...
Definition: OFKernelEventObserver.h:85
This protocol is implemented by classes which can be observed for readiness for writing by OFKernelEv...
Definition: OFKernelEventObserver.h:100
A delegate for OFSequencedPacketSocket.
Definition: OFSequencedPacketSocket.h:71
Definition: OFStream.h:101
A struct which represents a host / port pair for a socket.
Definition: socket.h:136