From 2e0bb1fcd55eb8235a8462e0e491394769848fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20L=C3=B6ffel?= Date: Tue, 9 Oct 2018 14:09:45 +0200 Subject: [PATCH] removed go routine for dial --- recws.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recws.go b/recws.go index f0aade2..6c49e0f 100644 --- a/recws.go +++ b/recws.go @@ -247,7 +247,7 @@ func (rc *RecConn) Dial(urlStr string, reqHeader http.Header) { rc.setDefaultDialer() // Connect - go rc.connect() + rc.connect() // wait on first attempt time.Sleep(rc.HandshakeTimeout) @@ -280,9 +280,7 @@ func (rc *RecConn) connect() { for { nextItvl := b.Duration() - rc.mu.Lock() wsConn, httpResp, err := rc.dialer.Dial(rc.url, rc.reqHeader) - rc.mu.Unlock() rc.mu.Lock() rc.Conn = wsConn