From f1d0dbe45a1d8520c0edd215951ff401267a7739 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Tue, 15 Nov 2011 22:57:29 +0000 Subject: [PATCH] If client-side ping can be disabled, we need to ensure something absorbs the shutdown message. --- client/connection.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/connection.go b/client/connection.go index b161d57..d92de24 100644 --- a/client/connection.go +++ b/client/connection.go @@ -201,6 +201,9 @@ func (conn *Conn) postConnect() { go conn.recv() if conn.PingFreq > 0 { go conn.ping() + } else { + // Otherwise the send in shutdown will hang :-/ + go func() { <-conn.cPing }() } go conn.runLoop() }