Skip to content

Commit

Permalink
Merge pull request #259 from sipcapture/ping_asap
Browse files Browse the repository at this point in the history
fix reconnect ping
  • Loading branch information
adubovikov authored Aug 15, 2023
2 parents 0499d48 + ce7ee6a commit 67317e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/sipcapture/heplify/sniffer"
)

const version = "heplify 1.65.7"
const version = "heplify 1.65.8"

func createFlags() {

Expand Down
11 changes: 10 additions & 1 deletion publish/hep.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (h *HEPOutputer) ReConnect(n int) (err error) {
return err
}
h.client[n].writer.Reset(h.client[n].conn)
h.ReSendPingPacket()
//h.ReSendPingPacket()
return err
}

Expand Down Expand Up @@ -124,6 +124,15 @@ func (h *HEPOutputer) Send(msg []byte) {
logp.Err("reconnect error: %v", err)
return
} else {
if h.msgPing != nil {
logp.Debug("collector", "send ping packet after disconnect")
h.client[n].writer.Write(h.msgPing)
err = h.client[n].writer.Flush()
if err != nil {
logp.Err("Bad during resend ping packet : %v", err)
}
}

h.client[n].writer.Write(msg)
err = h.client[n].writer.Flush()
if err != nil {
Expand Down

0 comments on commit 67317e2

Please sign in to comment.