From 7b4667c944536ee40a83e823a67d63e9370dee7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20L=C3=B6ffel?= Date: Tue, 9 Oct 2018 14:26:17 +0200 Subject: [PATCH] back to goroutine and added lock for get handshake --- recws.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recws.go b/recws.go index 6c49e0f..1832575 100644 --- a/recws.go +++ b/recws.go @@ -247,10 +247,10 @@ func (rc *RecConn) Dial(urlStr string, reqHeader http.Header) { rc.setDefaultDialer() // Connect - rc.connect() + go rc.connect() // wait on first attempt - time.Sleep(rc.HandshakeTimeout) + time.Sleep(rc.getHandshakeTimeout()) } // GetURL returns current connection url