code: func (c *Channel) Read(timeout ...time.Duration) (string, error) {
  	timeoutChan := make(chan (struct{}))
  
  	// Create a timeout timer if a timeout is specified.
  	if len(timeout) > 0 && timeout[0] > 0 {
  		timer := time.AfterFunc(timeout[0], func() {
  			// Trigger the timeout by closing the channel.
  			close(timeoutChan)
  		})
  
  		// Always stop the timer on defer.
  		defer timer.Stop()
  	}
  
  	select {
  	case data := <-c.readChan:
  		return data, nil
  	case <-c.s.isClosedChan:
  		// The connection was closed.
  		// Return an error.
  		return "", ErrSocketClosed
  	case <-timeoutChan:
  		// The timeout was reached.
  		// Return an error.
  		return "", ErrReadTimeout
  	}
  }
docs: // Read the next message from the channel. This method is blocking.
  // One variadic argument sets a timeout duration.
  // If no timeout is specified, this method will block forever.
  // ErrSocketClosed is returned, if the socket connection is closed.
  // ErrReadTimeout is returned, if the timeout is reached.