From ee6a9b981a13aef6066501984d53bf369ca74c2a Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 27 Mar 2012 20:53:27 -0700 Subject: Simplify sending whitespace keepalives. Now that we have the send lock, we can use now=True. --- sleekxmpp/xmlstream/xmlstream.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sleekxmpp/xmlstream') diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 125d4993..c3332c87 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -760,14 +760,11 @@ class XMLStream(object): self.whitespace_keepalive_interval = 300 """ - - def send_keepalive(): - if self.send_queue.empty(): - self.send_raw(' ') - self.schedule('Whitespace Keepalive', self.whitespace_keepalive_interval, - send_keepalive, + self.send_raw, + args = (' ',), + kwargs = {'now': True}, repeat=True) def _end_keepalive(self, event): -- cgit v1.2.3