code: func (w *Socket) readLoop() {
  	defer func() {
  		// Close the socket on defer.
  		w.Close()
  	}()
  
  	// Set the limits.
  	w.ws.SetReadLimit(maxMessageSize)
  
  	// Set the pong handler.
  	w.ws.SetPongHandler(func(string) error {
  		// Reset the read deadline.
  		w.ws.SetReadDeadline(time.Now().Add(readWait))
  		return nil
  	})
  
  	for {
  		// Reset the read deadline.
  		w.ws.SetReadDeadline(time.Now().Add(readWait))
  
  		// Read from the websocket.
  		_, data, err := w.ws.ReadMessage()
  		if err != nil {
  			// Websocket close code.
  			wsCode := -1 // -1 for not set.
  
  			// Try to obtain the websocket close code if present.
  			// Assert to gorilla websocket CloseError type if possible.
  			if closeErr, ok := err.(*websocket.CloseError); ok {
  				wsCode = closeErr.Code
  			}
  
  			// Only log errors if this is not EOF and
  			// if the socket was not closed already.
  			// Also check the websocket close code.
  			if err != io.EOF && !w.IsClosed() &&
  				wsCode != websocket.CloseNormalClosure &&
  				wsCode != websocket.CloseGoingAway &&
  				wsCode != websocket.CloseNoStatusReceived {
  				// Log
  				log.L.WithFields(logrus.Fields{
  					"remoteAddress": w.RemoteAddr(),
  					"userAgent":     w.UserAgent(),
  				}).Warningf("failed to read data from websocket: %v", err)
  			}
  
  			// Return and release this goroutine.
  			// This will close this socket connection.
  			return
  		}
  
  		// Write the received data to the read channel.
  		w.readChan <- string(data)
  	}
  }
docs: //###########################//
  //### WebSocket - Private ###//
  //###########################//
  // readLoop reads messages from the websocket