diff --git a/reach/client.go b/reach/client.go index 539df72..295e57d 100644 --- a/reach/client.go +++ b/reach/client.go @@ -39,6 +39,7 @@ func (c *client) Connect() error { c.conn = conn err = conn.On(gosocketio.OnConnection, func(h *gosocketio.Channel) { + conn.Off(gosocketio.OnError) c.logf("connected with sid '%s'", h.Id()) err = c.sendBrowserConnected() wg.Done() @@ -59,8 +60,6 @@ func (c *client) Connect() error { wg.Wait() - conn.On(gosocketio.OnError, nil) - return err }