code: func ListenAndServe(cfg *Config, srv *grpc.Server) (netListener net.Listener, err error) {
  	switch socketType := cfg.getSocketType(); socketType {
  	case "unix", "unixpacket":
  		permissions, err := getUnixSocketFilePermissions(cfg.Permission)
  		if err != nil {
  			return nil, err
  		}
  		if err := checkUnixSocketFileAndDirectory(cfg.Endpoint, cfg.ForceSocketRemoval); err != nil {
  			return nil, err
  		}
  
  		netListener, err = net.Listen(socketType, cfg.Endpoint)
  		if err != nil {
  			return nil, err
  		}
  
  		// Set permissions to the socket file
  		if err := os.Chmod(cfg.Endpoint, permissions); err != nil {
  			return nil, err
  		}
  	default:
  		netListener, err = net.Listen(socketType, cfg.Endpoint)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	go func() {
  		err := srv.Serve(netListener)
  		// Serve always returns non-nil error
  		logging.DefaultLogger.Debugf("GRPC server Serve: %v", err)
  	}()
  
  	return netListener, nil
  }
docs: // ListenAndServe starts configured listener and serving for clients