Skip to content

Commit

Permalink
Do not re-invoke send_syn if a call is already scheduled.
Browse files Browse the repository at this point in the history
  • Loading branch information
Renelvon committed Jun 11, 2015
1 parent 1dea1e9 commit 0f5a410
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions txrudp/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __init__(self, proto, handler, own_addr, dest_addr, relay_addr=None):
self._looping_receive = task.LoopingCall(self._pop_received_packet)

# Initiate SYN sequence after receiving any pending SYN message.
REACTOR.callLater(0, self._send_syn)
self._syn_handle = REACTOR.callLater(0, self._send_syn)

def send_message(self, message):
"""
Expand Down Expand Up @@ -458,7 +458,8 @@ def _process_syn_packet(self, rudp_packet):
else:
self._next_expected_seqnum = rudp_packet.sequence_number + 1
self._clear_sending_window()
self._send_syn()
if not self._syn_handle.active():
self._send_syn()
self.connected = True

def _retire_packets_with_seqnum_up_to(self, acknum):
Expand Down

0 comments on commit 0f5a410

Please sign in to comment.