Skip to content
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

ofLoadURL() function does not close the created socket #5149

Open
jmiguelff opened this issue Jul 4, 2016 · 0 comments
Open

ofLoadURL() function does not close the created socket #5149

jmiguelff opened this issue Jul 4, 2016 · 0 comments

Comments

@jmiguelff
Copy link

So this problem can be spoted if you use the ofLoadURL() function on the update(). After a while you will have a bunch of sockets with the WAIT_CLOSE status and the application will fail. On win10 if you run netstat -an on the command line you will see a bunch of sockets being used there.

After some research I found out the problem may be on this function: ofHttpResponse ofURLFileLoaderImpl::handleRequest(ofHttpRequest request).

This function creates a new instance of HTTPClientSession every time it runs, HTTPClientSession * httpSession = new HTTPClientSession(uri.getHost(), uri.getPort());. And after receiving the info from the link you provided it does not destroy this instance leaving the socket open.

As I reported on the forum, https://forum.openframeworks.cc/t/repeat-usage-of-ofloadurl-causes-i-o-error-no-buffer-space-available/23747/1 I found out a quick fix (explained there). However, I think it should be better to just use the deconstructor after getting the information from the web link.

I hope this information is enough for you guys to understand the issue 💃

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

No branches or pull requests

1 participant