|
|
@ -11,14 +11,11 @@ import ( |
|
|
|
"time" |
|
|
|
|
|
|
|
wire "github.com/tendermint/go-wire" |
|
|
|
tmlegacy "github.com/tendermint/go-wire/nowriter/tmlegacy" |
|
|
|
cmn "github.com/tendermint/tmlibs/common" |
|
|
|
flow "github.com/tendermint/tmlibs/flowrate" |
|
|
|
"github.com/tendermint/tmlibs/log" |
|
|
|
) |
|
|
|
|
|
|
|
var legacy = tmlegacy.TMEncoderLegacy{} |
|
|
|
|
|
|
|
const ( |
|
|
|
numBatchMsgPackets = 10 |
|
|
|
minReadBufferSize = 1024 |
|
|
@ -316,12 +313,12 @@ FOR_LOOP: |
|
|
|
} |
|
|
|
case <-c.pingTimer.Chan(): |
|
|
|
c.Logger.Debug("Send Ping") |
|
|
|
legacy.WriteOctet(packetTypePing, c.bufWriter, &n, &err) |
|
|
|
wire.WriteByte(packetTypePing, c.bufWriter, &n, &err) |
|
|
|
c.sendMonitor.Update(int(n)) |
|
|
|
c.flush() |
|
|
|
case <-c.pong: |
|
|
|
c.Logger.Debug("Send Pong") |
|
|
|
legacy.WriteOctet(packetTypePong, c.bufWriter, &n, &err) |
|
|
|
wire.WriteByte(packetTypePong, c.bufWriter, &n, &err) |
|
|
|
c.sendMonitor.Update(int(n)) |
|
|
|
c.flush() |
|
|
|
case <-c.quit: |
|
|
@ -681,7 +678,7 @@ func (ch *Channel) writeMsgPacketTo(w io.Writer) (n int, err error) { |
|
|
|
} |
|
|
|
|
|
|
|
func writeMsgPacketTo(packet msgPacket, w io.Writer, n *int, err *error) { |
|
|
|
legacy.WriteOctet(packetTypeMsg, w, n, err) |
|
|
|
wire.WriteByte(packetTypeMsg, w, n, err) |
|
|
|
wire.WriteBinary(packet, w, n, err) |
|
|
|
} |
|
|
|
|
|
|
|