18 #import "OFKernelEventObserver.h"
22 OF_ASSUME_NONNULL_BEGIN
35 struct sockaddr_storage address;
100 + (instancetype)socket;
111 + (void)resolveAddressForHost: (
OFString*)host
115 #ifdef OF_HAVE_THREADS
128 + (void)asyncResolveAddressForHost: (
OFString*)host
131 selector: (
SEL)selector;
133 # ifdef OF_HAVE_BLOCKS
142 + (void)asyncResolveAddressForHost: (
OFString*)host
157 + (void)getHost: (
OFString *__autoreleasing OF_NONNULL *OF_NULLABLE)host
158 andPort: (uint16_t *OF_NULLABLE)port
170 - (uint16_t)bindToHost: (
OFString*)host
171 port: (uint16_t)port;
184 - (size_t)receiveIntoBuffer: (
void*)buffer
185 length: (
size_t)length
206 - (void)asyncReceiveIntoBuffer: (
void*)buffer
207 length: (
size_t)length
209 selector: (
SEL)selector;
211 #ifdef OF_HAVE_BLOCKS
227 - (void)asyncReceiveIntoBuffer: (
void*)buffer
228 length: (
size_t)length
240 - (void)sendBuffer: (const
void*)buffer
241 length: (
size_t)length
253 - (void)cancelAsyncRequests;
286 OF_ASSUME_NONNULL_END
A class which provides functions to create and use UDP sockets.
Definition: OFUDPSocket.h:89
This protocol is implemented by classes which can be observed for readiness for reading by OFKernelEv...
Definition: OFKernelEventObserver.h:73
The root class for all other classes inside ObjFW.
Definition: OFObject.h:364
A class for handling strings.
Definition: OFString.h:91
The base class for all exceptions in ObjFW.
Definition: OFException.h:144
This protocol is implemented by classes which can be observed for readiness for writing by OFKernelEv...
Definition: OFKernelEventObserver.h:91
A protocol for the creation of copies.
Definition: OFObject.h:896
uint32_t of_udp_socket_address_hash(of_udp_socket_address_t *address)
Returns the hash for the specified of_udp_socket_address_t.
Definition: OFUDPSocket.m:231
bool(^ of_udp_socket_async_receive_block_t)(OFUDPSocket *socket, void *buffer, size_t length, of_udp_socket_address_t sender, OFException *OF_NULLABLE exception)
A block which is called when a packet has been received.
Definition: OFUDPSocket.h:65
void(^ of_udp_socket_async_resolve_block_t)(OFString *host, uint16_t port, of_udp_socket_address_t address, OFException *OF_NULLABLE exception)
A block which is called when the host / port pair for the UDP socket has been resolved.
Definition: OFUDPSocket.h:50
bool of_udp_socket_address_equal(of_udp_socket_address_t *address1, of_udp_socket_address_t *address2)
Compares two of_udp_socket_address_t for equality.
Definition: OFUDPSocket.m:179
A struct which represents a host / port pair for a UDP socket.
Definition: OFUDPSocket.h:34