start reader loop after connect

This commit is contained in:
Marcelo Pires 2018-09-05 15:06:25 +02:00
parent 6ae3cf9df8
commit 3586f4d799

View File

@ -30,6 +30,7 @@ type Websocket struct {
conn *websocket.Conn conn *websocket.Conn
clientID string clientID string
msgID *uint64 msgID *uint64
once sync.Once
subsMu sync.Mutex //todo sync.Map subsMu sync.Mutex //todo sync.Map
subs map[string]chan *message.Message subs map[string]chan *message.Message
@ -130,6 +131,8 @@ func (w *Websocket) Connect() error {
Id: w.nextMsgID(), Id: w.nextMsgID(),
} }
//todo verify if extensions are applied on connect,verify if hs is complete //todo verify if extensions are applied on connect,verify if hs is complete
go w.readWorker()
return w.sendMessage(&m) return w.sendMessage(&m)
} }