joemiller/collectd-graphite — pull request #14 by amosshapira (2012-07-20 06:02:11+00:00)
Title: Make the socket permanent

Instead of opening and closing the socket on every write, this change keeps the socket open the first time it's required and closes it on flush.

Due to the way the collectd-perl works with threads, a separate socket will be maintained for each collectd thread. On my systems this means 5 connections. I think this is a good trade-off to constant open/close of sockets.

If the print to the socket fails then close it so the next time around it will be re-created.