From 3586f4d799839e0ccc66662f57c4f1e31b8dc2da Mon Sep 17 00:00:00 2001 From: Marcelo Pires Date: Wed, 5 Sep 2018 15:06:25 +0200 Subject: [PATCH] start reader loop after connect --- transport/websocket/websocket.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transport/websocket/websocket.go b/transport/websocket/websocket.go index 78239bf..64b2a97 100644 --- a/transport/websocket/websocket.go +++ b/transport/websocket/websocket.go @@ -30,6 +30,7 @@ type Websocket struct { conn *websocket.Conn clientID string msgID *uint64 + once sync.Once subsMu sync.Mutex //todo sync.Map subs map[string]chan *message.Message @@ -130,6 +131,8 @@ func (w *Websocket) Connect() error { Id: w.nextMsgID(), } //todo verify if extensions are applied on connect,verify if hs is complete + + go w.readWorker() return w.sendMessage(&m) }