Skip to content

Close stream resource if connection fails #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2016

Conversation

clue
Copy link
Contributor

@clue clue commented Oct 13, 2015

Currently, if a connection attempt is being rejected, the resulting promise will successfully be rejected. However, the underlying socket resource will not be closed (and is not exposed to the outside).

This is a trivial fix for leaking these resources.

This situation is already covered by our test cases, so it does not include additional tests. We could look into counting open socket descriptors, but we'd likely have to resort to using system utilities as PHP does not appear to offer anything related.

This PR builds on top of #46, so the diff also includes its changes. Look here for changes only related to this PR alone. (no longer applies after rebasing)

@clue
Copy link
Contributor Author

clue commented Nov 21, 2015

I've just rebased this on the current master now that #46 is in.

Ready for review :)

@clue clue added the bug label Nov 21, 2015
@clue clue added this to the v0.5 milestone Nov 21, 2015
@WyriHaximus
Copy link
Contributor

LGTM :shipit:

cboden added a commit that referenced this pull request Feb 23, 2016
Close stream resource if connection fails
@cboden cboden merged commit a14adf5 into reactphp-legacy:master Feb 23, 2016
@clue clue deleted the close branch August 1, 2016 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants