Skip to content

Commit 093f4b3

Browse files
committed
Merge pull request robbiehanson#26 from kylef/refused
Fix an issue where a refused connection will not be cleaned up properly
2 parents 97594c4 + 6f46421 commit 093f4b3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

GCD/GCDAsyncSocket.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2579,7 +2579,18 @@ - (void)closeWithError:(NSError *)error
25792579

25802580
accept6Source = NULL;
25812581
}
2582-
2582+
if (!readSource && !writeSource) {
2583+
LogVerbose(@"manually closing close");
2584+
2585+
if (socket4FD) {
2586+
close(socket4FD);
2587+
}
2588+
2589+
if (socket6FD) {
2590+
close(socket6FD);
2591+
}
2592+
}
2593+
25832594
if (readSource)
25842595
{
25852596
LogVerbose(@"dispatch_source_cancel(readSource)");

0 commit comments

Comments
 (0)