code: func (c *BaseConn) Close() error {
  	c.sMutex.Lock()
  	defer c.sMutex.Unlock()
  
  	// flush buffer
  	err1 := c.stream.Flush()
  
  	// close carrier
  	err2 := c.carrier.Close()
  
  	// handle errors
  	if err1 != nil {
  		return err1
  	} else if err2 != nil {
  		return err2
  	}
  
  	return nil
  }
docs: // Close will close the underlying connection and cleanup resources. It will
  // return an Error if there was an error while closing the underlying
  // connection.