ObjFW  Diff

Differences From Artifact [15a3d3213a]:

To Artifact [2735f938b2]:


252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
252
253
254
255
256
257
258







259
260
261
262
263
264
265







-
-
-
-
-
-
-







	uint16_t destinationPort = port;
	of_resolver_result_t **results, **iter;
	int errNo = 0;

	if (_socket != INVALID_SOCKET)
		@throw [OFAlreadyConnectedException exceptionWithSocket: self];

	_listening = false;

	/* Make sure to clear the read buffer in case the socket is reused */
	[self freeMemory: _readBuffer];
	_readBuffer = NULL;
	_readBufferLength = 0;

	if (_SOCKS5Host != nil) {
		/* Connect to the SOCKS5 proxy instead */
		host = _SOCKS5Host;
		port = _SOCKS5Port;
	}

	results = of_resolve_host(host, port, SOCK_STREAM);
662
663
664
665
666
667
668















669
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

		@throw [OFGetOptionFailedException
		    exceptionWithStream: self
				  errNo: of_socket_errno()];

	return v;
}
#endif

- (void)close
{
	_listening = false;

	[self freeMemory: _address];
	_address = NULL;
	_addressLength = 0;

#ifdef OF_WII
	_port = 0;
#endif

	[super close];
}
@end