diff --git a/device/send.go b/device/send.go index b4e23c7..ccb28da 100644 --- a/device/send.go +++ b/device/send.go @@ -601,6 +601,9 @@ func (peer *Peer) RoutineSequentialSender() { length := uint64(len(elem.packet)) err := peer.SendBuffer(elem.packet) + if len(elem.packet) != MessageKeepaliveSize { + peer.timersDataSent() + } device.PutMessageBuffer(elem.buffer) device.PutOutboundElement(elem) if err != nil { @@ -609,9 +612,6 @@ func (peer *Peer) RoutineSequentialSender() { } atomic.AddUint64(&peer.stats.txBytes, length) - if len(elem.packet) != MessageKeepaliveSize { - peer.timersDataSent() - } peer.keepKeyFreshSending() } }