17 #import "OFStreamSocket.h"
21 OF_ASSUME_NONNULL_BEGIN
64 struct sockaddr *_address;
65 socklen_t _addressLength;
70 #ifdef OF_HAVE_PROPERTIES
71 @property (readonly, getter=isListening)
bool listening;
72 @property OF_NULLABLE_PROPERTY (copy)
OFString *SOCKS5Host;
73 @property uint16_t SOCKS5Port;
74 @property (getter=isKeepAliveEnabled)
bool keepAliveEnabled;
75 @property (getter=isTCPNoDelayEnabled)
bool TCPNoDelayEnabled;
84 + (void)setSOCKS5Host: (nullable
OFString*)SOCKS5Host;
98 + (void)setSOCKS5Port: (uint16_t)SOCKS5Port;
105 + (uint16_t)SOCKS5Port;
112 - (void)setSOCKS5Host: (nullable
OFString*)host;
128 - (void)setSOCKS5Port: (uint16_t)port;
135 - (uint16_t)SOCKS5Port;
143 - (void)connectToHost: (
OFString*)host
144 port: (uint16_t)port;
146 #ifdef OF_HAVE_THREADS
157 - (void)asyncConnectToHost: (
OFString*)host
160 selector: (
SEL)selector;
162 # ifdef OF_HAVE_BLOCKS
170 - (void)asyncConnectToHost: (
OFString*)host
185 - (uint16_t)bindToHost: (
OFString*)host
186 port: (uint16_t)port;
193 - (void)listenWithBackLog: (
int)backLog;
205 - (instancetype)accept;
218 - (void)asyncAcceptWithTarget: (
id)target
219 selector: (
SEL)selector;
221 #ifdef OF_HAVE_BLOCKS
239 - (nullable
OFString*)remoteAddress;
253 - (void)setKeepAliveEnabled: (
bool)enabled;
260 - (bool)isKeepAliveEnabled;
267 - (void)setTCPNoDelayEnabled: (
bool)enabled;
274 - (bool)isTCPNoDelayEnabled;
280 extern Class OF_NULLABLE of_tls_socket_class;
285 OF_ASSUME_NONNULL_END
A class for handling strings.
Definition: OFString.h:91
void(^ of_tcp_socket_async_connect_block_t)(OFTCPSocket *socket, OFException *OF_NULLABLE exception)
A block which is called when the socket connected.
Definition: OFTCPSocket.h:36
A class which provides functions to create and use TCP sockets.
Definition: OFTCPSocket.h:61
bool(^ of_tcp_socket_async_accept_block_t)(OFTCPSocket *socket, OFTCPSocket *acceptedSocket, OFException *OF_NULLABLE exception)
A block which is called when the socket accepted a connection.
Definition: OFTCPSocket.h:49
The base class for all exceptions in ObjFW.
Definition: OFException.h:144
A class which provides functions to create and use stream sockets.
Definition: OFStreamSocket.h:28