113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
}
- (instancetype)init
{
self = [super init];
@try {
_socket = INVALID_SOCKET;
_SOCKS5Host = [defaultSOCKS5Host copy];
_SOCKS5Port = defaultSOCKS5Port;
} @catch (id e) {
[self release];
@throw e;
}
|
<
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
}
- (instancetype)init
{
self = [super init];
@try {
_SOCKS5Host = [defaultSOCKS5Host copy];
_SOCKS5Port = defaultSOCKS5Port;
} @catch (id e) {
[self release];
@throw e;
}
|
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
_socket = INVALID_SOCKET;
}
- (void)connectToHost: (OFString *)host
port: (uint16_t)port
{
void *pool = objc_autoreleasePoolPush();
id <OFTCPSocketDelegate> delegate = [_delegate retain];
OFTCPSocketConnectDelegate *connectDelegate =
[[[OFTCPSocketConnectDelegate alloc] init] autorelease];
OFRunLoop *runLoop = [OFRunLoop currentRunLoop];
self.delegate = connectDelegate;
[self asyncConnectToHost: host
port: port
|
|
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
_socket = INVALID_SOCKET;
}
- (void)connectToHost: (OFString *)host
port: (uint16_t)port
{
void *pool = objc_autoreleasePoolPush();
id <OFTCPSocketDelegate> delegate = _delegate;
OFTCPSocketConnectDelegate *connectDelegate =
[[[OFTCPSocketConnectDelegate alloc] init] autorelease];
OFRunLoop *runLoop = [OFRunLoop currentRunLoop];
self.delegate = connectDelegate;
[self asyncConnectToHost: host
port: port
|