def _send_data(self, data):
        """
        Try to send all data in buffer.
        """
        try:
            self.socket.sendall(data)
            self._reset_errors()
        except:
            self._close()
            self._throttle_error("GraphiteHandler: Socket error, "
                                 "trying reconnect.")
            self._connect()
            try:
                self.socket.sendall(data)
            except:
                return
            self._reset_errors()

        Try to send all data in buffer.
        
src/diamond/handler/graphite.py