17 #ifndef __STDC_LIMIT_MACROS
18 # define __STDC_LIMIT_MACROS
20 #ifndef __STDC_CONSTANT_MACROS
21 # define __STDC_CONSTANT_MACROS
25 # include <sys/types.h>
26 # include <sys/socket.h>
30 #import "OFStreamSocket.h"
33 # include <ws2tcpip.h>
54 struct sockaddr_storage *sockAddr;
55 socklen_t sockAddrLen;
60 #ifdef OF_HAVE_PROPERTIES
61 @property (readonly, getter=isListening) BOOL listening;
62 @property (copy)
OFString *SOCKS5Host;
63 @property uint16_t SOCKS5Port;
71 + (void)setSOCKS5Host: (
OFString*)host;
85 + (void)setSOCKS5Port: (uint16_t)port;
92 + (uint16_t)SOCKS5Port;
99 - (void)setSOCKS5Host: (
OFString*)host;
115 - (void)setSOCKS5Port: (uint16_t)port;
122 - (uint16_t)SOCKS5Port;
130 - (void)connectToHost: (
OFString*)host
131 port: (uint16_t)port;
143 - (void)asyncConnectToHost: (
OFString*)host
146 selector: (
SEL)selector;
148 #ifdef OF_HAVE_BLOCKS
156 - (void)asyncConnectToHost: (
OFString*)host
158 block: (of_tcpsocket_async_connect_block_t)block;
170 - (uint16_t)bindToHost: (
OFString*)host
171 port: (uint16_t)port;
178 - (void)listenWithBackLog: (
int)backLog;
203 - (void)asyncAcceptWithTarget: (
id)target
204 selector: (
SEL)selector;
206 #ifdef OF_HAVE_BLOCKS
214 - (void)asyncAcceptWithBlock: (of_tcpsocket_async_accept_block_t)block;
222 - (void)setKeepAlivesEnabled: (BOOL)enable;