-
Notifications
You must be signed in to change notification settings - Fork 191
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
connections are never closed #11
Comments
Have you tried using the inactivity_timeout option? |
no I haven't where and how should I set this option? |
It was supposed to be used like this. ibrowse:send_req(Host, Port, Method, Headers, [{inactivity_timeout, 5000} | Other_options]). But it only works if a request is in progress. But that is a bit silly, it should work even if all requests on that connection are done and the connection is idle. I'll make a patch and let you know. Thanks for reporting it. |
Here is a patch against ibrowse-2.0.1 The connection will close after 10 seconds of inactivity on the connection. You can control this timeout value by the ibrowse application variable inactivity_timeout (either set in ibrowse.app or your sys.config file) |
The updated patch at the link below supports specifying this config in ibrowse.conf as well. |
I'll give it a try. thanks |
I applyed your patch but I get this error:
looks like the state is being set to undefined somewhere. |
I added this two lines to the set_inac_timer/2 to solve the problem:
After some debugging I noticed that get_inac_timeout/1 was returning infinity and that would cause set_inac_timer/2 to return 'undefined'. let me know if this is the right way to solve the problem. |
That's great, thanks very much. I'll commit it soon... |
It works thanks. |
ibrowse never timesout on a open connection if the server never closes the connection.
This will cause an application that connects to several different domains to eventually exhaust all file descriptors.
I suggest the use of some sort of argument to explicitly pass a timeout in seconds or infinity to a send_req.
The connection should be closed after the timeout has expired.
The text was updated successfully, but these errors were encountered: