Stager first ping from server and suppress pings if a ping was received.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2019-06-29 15:43:15 -07:00
parent 7d11d9288f
commit ebd4deb8b9
4 changed files with 76 additions and 9 deletions

View File

@@ -1609,8 +1609,8 @@ func (s *Server) createClient(conn net.Conn) *client {
// Do final client initialization
// Set the Ping timer
c.setPingTimer()
// Set the First Ping timer.
c.setFirstPingTimer(opts.PingInterval)
// Spin up the read loop.
s.startGoRoutine(func() { c.readLoop() })