code: func (s *Socket) Close() error {
  	if s.err != nil {
  		// nothing to close
  		return nil
  	}
  
  	defer s.conn.Close()
  
  	if err := s.enc.Flush(); err != nil {
  		return fmt.Errorf("flush: %s", err)
  	}
  	return s.enc.Close()
  }
docs: // Close the socket and flush the remaining frames.