From 3183c9f1776eb7090f40cb68b2d965b12d40b0ab Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Tue, 15 Nov 2011 22:22:40 +0000 Subject: [PATCH] Allow client-side ping to be disabled by setting PingFreq to zero. --- client/connection.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/connection.go b/client/connection.go index a2e3bb3..b161d57 100644 --- a/client/connection.go +++ b/client/connection.go @@ -199,7 +199,9 @@ func (conn *Conn) postConnect() { conn.sock.SetTimeout(conn.Timeout * second) go conn.send() go conn.recv() - go conn.ping() + if conn.PingFreq > 0 { + go conn.ping() + } go conn.runLoop() }