Skip to content

Close socket on descruct #35

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

Closed
wants to merge 2 commits into from
Closed

Close socket on descruct #35

wants to merge 2 commits into from

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Jan 6, 2018

When inspecting the code I did not find that we close the socket. We only close it on Exception. This PR will fix that.

Original issue is here: php-http/logger-plugin#3

Ping @soullivaneuh

@soullivaneuh
Copy link

Unfortunately, it does not solve the issue:

sullivan@5928a6b35210:/code$ php test.php 
Running: 1	ExitCode: 0	LSOF: 32
Running: 1	ExitCode: 0	LSOF: 35
Running: 1	ExitCode: 0	LSOF: 38
Running: 1	ExitCode: 0	LSOF: 41
Running: 1	ExitCode: 0	LSOF: 44
Running: 1	ExitCode: 0	LSOF: 47
Running: 1	ExitCode: 0	LSOF: 50
Running: 1	ExitCode: 0	LSOF: 53
Running: 1	ExitCode: 0	LSOF: 56
Running: 1	ExitCode: 0	LSOF: 59
Running: 1	ExitCode: 0	LSOF: 62
Running: 1	ExitCode: 0	LSOF: 65
Running: 1	ExitCode: 0	LSOF: 68
Running: 1	ExitCode: 0	LSOF: 71
Running: 1	ExitCode: 0	LSOF: 74
Running: 1	ExitCode: 0	LSOF: 77
Running: 1	ExitCode: 0	LSOF: 80
Running: 1	ExitCode: 0	LSOF: 83
Running: 1	ExitCode: 0	LSOF: 86
Running: 0	ExitCode: 0	LSOF: 89

@Nyholm
Copy link
Member Author

Nyholm commented Jan 6, 2018

Okey, Thank you for testing.

As we discussed on Slack: (@joelwurtz @kelunik)

AFAIK php close socket when it's garbage collected and do it better than using fclose

@Nyholm Nyholm closed this Jan 6, 2018
@Nyholm Nyholm deleted the patch-close branch January 6, 2018 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants