~ubuntuone-pqm-team/amqp/stable

« back to all changes in this revision

Viewing changes to amqp/connection.py

  • Committer: Ask Solem
  • Date: 2014-10-22 15:20:38 UTC
  • Revision ID: git-v1:a4192f5ce186c6b9cbee716a58047243599ea641
Frame writer stop should raise RecoverableConnectionError

Show diffs side-by-side

added added

removed removed

Lines of Context:
556
556
        self._do_close()
557
557
 
558
558
    def send_heartbeat(self):
559
 
        self._frame_writer.send((8, 0, None, None, None))
 
559
        try:
 
560
            self._frame_writer.send((8, 0, None, None, None))
 
561
        except StopIteration:
 
562
            raise RecoverableConnectionError('connection already closed')
560
563
 
561
564
    def heartbeat_tick(self, rate=2):
562
565
        """Send heartbeat packets, if necessary, and fail if none have been