{"issue":{"state":"open","created_at":"2011-09-15T17:00:45Z","updated_at":"2011-12-13T23:26:45Z","comments":3,"user":{"gravatar_id":"a0b49382b6dcd9dd4602c3088717724e","id":45,"url":"https://api.github.com/users/mojodna","avatar_url":"https://secure.gravatar.com/avatar/a0b49382b6dcd9dd4602c3088717724e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"mojodna"},"body":"The use of a single, shared socket that's never closed prevents node processes from completing normally.\r\n\r\nThis change allows an optional shared socket to be passed into the constructor. If present, node-statsd will use that (and will assume that the provider will close it when appropriate).  Otherwise, node-statsd will create new sockets for each connection (the old, less efficient behavior).\r\n\r\n@tmm1 - I was thinking about ways to default to the shared behavior, but the only way I could think of to do that cleanly involved a dynamic getter and a `setInterval` that periodically checks whether the socket has been used recently (in ms) and closes it if not (to be recreated in the getter as necessary).  I'm curious to hear your thoughts.","assignee":null,"id":1654825,"labels":[],"number":6,"pull_request":{"patch_url":"https://github.com/sivy/node-statsd/pull/6.patch","html_url":"https://github.com/sivy/node-statsd/pull/6","diff_url":"https://github.com/sivy/node-statsd/pull/6.diff"},"title":"Default to ephemeral sockets","html_url":"https://github.com/sivy/node-statsd/issues/6","closed_at":null,"url":"https://api.github.com/repos/sivy/node-statsd/issues/6","milestone":null},"action":"created","comment":{"created_at":"2011-12-13T23:26:45Z","updated_at":"2011-12-13T23:26:45Z","user":{"gravatar_id":"a4b05606a77ceb215c1f142235f9ec95","id":18625,"url":"https://api.github.com/users/ulfmagnetics","avatar_url":"https://secure.gravatar.com/avatar/a4b05606a77ceb215c1f142235f9ec95?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"ulfmagnetics"},"body":"+1","id":3132638,"url":"https://api.github.com/repos/sivy/node-statsd/issues/comments/3132638"}}