code: func (c *Client) readLoop() error {
  	for {
  		p, err := c.receiveData()
  
  		c.LocalKite.Log.Debug("readloop received: %s %v", p, err)
  
  		if err != nil {
  			return err
  		}
  
  		msg, fn, err := c.processMessage(p)
  		if err != nil {
  			if _, ok := err.(dnode.CallbackNotFoundError); !ok {
  				c.LocalKite.Log.Warning("error processing message err: %s message: %s", err, msg)
  			}
  		}
  
  		switch v := fn.(type) {
  		case *Method: // invoke method
  			if c.Concurrent {
  				go c.runMethod(v, msg.Arguments)
  			} else {
  				c.runMethod(v, msg.Arguments)
  			}
  		case func(*dnode.Partial): // invoke callback
  			if c.Concurrent && c.ConcurrentCallbacks {
  				go c.runCallback(v, msg.Arguments)
  			} else {
  				c.runCallback(v, msg.Arguments)
  			}
  		}
  	}
  }
docs: // readLoop reads a message from websocket and processes it.