17 #import "OFStreamSocket.h" 21 OF_ASSUME_NONNULL_BEGIN
64 struct sockaddr *_Nullable _address;
65 socklen_t _addressLength;
89 + (void)setSOCKS5Host: (nullable
OFString *)SOCKS5Host;
103 + (void)setSOCKS5Port: (uint16_t)SOCKS5Port;
118 - (void)connectToHost: (
OFString *)host
119 port: (uint16_t)port;
121 #ifdef OF_HAVE_THREADS 132 - (void)asyncConnectToHost: (
OFString *)host
135 selector: (
SEL)selector;
137 # ifdef OF_HAVE_BLOCKS 145 - (void)asyncConnectToHost: (
OFString *)host
160 - (uint16_t)bindToHost: (
OFString *)host
161 port: (uint16_t)port;
168 - (void)listenWithBackLog: (
int)backLog;
193 - (void)asyncAcceptWithTarget: (
id)target
194 selector: (
SEL)selector;
196 #ifdef OF_HAVE_BLOCKS 223 #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) 231 - (void)setKeepAliveEnabled: (
bool)enabled;
251 - (void)setTCPNoDelayEnabled: (
bool)enabled;
267 extern Class _Nullable of_tls_socket_class;
272 OF_ASSUME_NONNULL_END
bool isKeepAliveEnabled()
Returns whether keep alive is enabled for the connection.
Definition: OFTCPSocket.m:623
id copy()
Returns the class.
Definition: OFObject.m:1133
A class for handling strings.
Definition: OFString.h:114
nullable OFString * remoteAddress()
Returns the remote address of the socket.
Definition: OFTCPSocket.m:591
nullable OFString * SOCKS5Host()
Returns the host to use as a SOCKS5 proxy when creating a new socket.
The base class for all exceptions in ObjFW.
Definition: OFException.h:143
A class which provides methods to create and use TCP sockets.
Definition: OFTCPSocket.h:61
A class which provides methods to create and use stream sockets.
Definition: OFStreamSocket.h:28
bool isListening()
Returns whether the socket is a listening socket.
Definition: OFTCPSocket.m:606
instancetype accept()
Accept an incoming connection.
Definition: OFTCPSocket.m:521
bool isTCPNoDelayEnabled()
Returns whether TCP_NODELAY is enabled for the connection.
Definition: OFTCPSocket.m:650
void(^ of_tcp_socket_async_connect_block_t)(OFTCPSocket *socket, OFException *_Nullable exception)
A block which is called when the socket connected.
Definition: OFTCPSocket.h:36
nonatomic
Definition: OFTCPSocket.h:76
bool(^ of_tcp_socket_async_accept_block_t)(OFTCPSocket *socket, OFTCPSocket *acceptedSocket, OFException *_Nullable exception)
A block which is called when the socket accepted a connection.
Definition: OFTCPSocket.h:49
void listen()
Listen on the socket.
Definition: OFTCPSocket.m:502
uint16_t SOCKS5Port()
Returns the port to use as a SOCKS5 proxy when creating a new socket.