Only call _start_transmit when required; closes #165.

This commit is contained in:
David Wilson 2018-03-29 16:06:18 +05:45
parent 80a97fbc9b
commit 6db3588c93
1 changed files with 3 additions and 1 deletions

View File

@ -862,8 +862,10 @@ class Stream(BasicStream):
pkt = struct.pack(self.HEADER_FMT, msg.dst_id, msg.src_id,
msg.auth_id, msg.handle, msg.reply_to or 0,
len(msg.data)) + msg.data
was_transmitting = len(self._output_buf)
self._output_buf.append(pkt)
self._router.broker._start_transmit(self)
if not was_transmitting:
self._router.broker._start_transmit(self)
def send(self, msg):
"""Send `data` to `handle`, and tell the broker we have output. May