Skip to content

Commit dd30324

Browse files
authored
Merge pull request #159 from clue-labs/memory
Improve memory consumption for cancelled connection attempts
2 parents 23a1e62 + c1aedc3 commit dd30324

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/TcpConnector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ private function waitForStreamOnce($stream)
112112
$resolve(new Connection($stream, $loop));
113113
}
114114
});
115-
}, function () use ($loop, $stream) {
115+
}, function ($resolve, $reject, $progress) use ($loop, $stream) {
116116
$loop->removeWriteStream($stream);
117117
fclose($stream);
118118

119+
$resolve = $reject = $progress = null;
119120
throw new RuntimeException('Cancelled while waiting for TCP/IP connection to be established');
120121
});
121122
}

0 commit comments

Comments
 (0)