18 #import "OFKernelEventObserver.h" 22 OF_ASSUME_NONNULL_BEGIN
35 struct sockaddr_storage address;
104 + (instancetype)socket;
115 + (void)resolveAddressForHost: (
OFString *)host
119 #ifdef OF_HAVE_THREADS 132 + (void)asyncResolveAddressForHost: (
OFString *)host
135 selector: (SEL)selector;
137 # ifdef OF_HAVE_BLOCKS 146 + (void)asyncResolveAddressForHost: (
OFString *)host
161 + (void)getHost: (
OFString *__autoreleasing _Nonnull *_Nullable)host
162 andPort: (nullable uint16_t *)port
174 - (uint16_t)bindToHost: (
OFString *)host
175 port: (uint16_t)port;
188 - (size_t)receiveIntoBuffer: (
void *)buffer
189 length: (size_t)length
210 - (void)asyncReceiveIntoBuffer: (
void *)buffer
211 length: (size_t)length
213 selector: (SEL)selector;
215 #ifdef OF_HAVE_BLOCKS 231 - (void)asyncReceiveIntoBuffer: (
void *)buffer
232 length: (size_t)length
244 - (void)sendBuffer: (
const void *)buffer
245 length: (size_t)length
251 - (void)cancelAsyncRequests;
284 OF_ASSUME_NONNULL_END
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:177
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:234
A class for handling strings.
Definition: OFString.h:114
A class which provides methods to create and use UDP sockets.
Definition: OFUDPSocket.h:90
void(^ of_udp_socket_async_resolve_block_t)(OFString *host, uint16_t port, of_udp_socket_address_t address, OFException *_Nullable exception)
A block which is called when the host / port pair for the UDP socket has been resolved.
Definition: OFUDPSocket.h:50
The base class for all exceptions in ObjFW.
Definition: OFException.h:143
A protocol for the creation of copies.
Definition: OFObject.h:914
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
bool(^ of_udp_socket_async_receive_block_t)(OFUDPSocket *socket, void *buffer, size_t length, of_udp_socket_address_t sender, OFException *_Nullable exception)
A block which is called when a packet has been received.
Definition: OFUDPSocket.h:65
This protocol is implemented by classes which can be observed for readiness for writing by OFKernelEv...
A struct which represents a host / port pair for a UDP socket.
Definition: OFUDPSocket.h:34
This protocol is implemented by classes which can be observed for readiness for reading by OFKernelEv...