code: func (pe *providerEndpoint) Connect(args *ConnectRequest, resp *ConnectResponse) error {
  	defer metrics.IncrCounter([]string{"scada", "connect", args.Capability}, 1)
  	pe.p.logger.Printf("[INFO] scada-client: connect requested (capability: %s)",
  		args.Capability)
  
  	// Handle potential flash
  	if args.Severity != "" && args.Message != "" {
  		pe.p.logger.Printf("[%s] scada-client: %s", args.Severity, args.Message)
  	}
  
  	// Look for the handler
  	handler := pe.p.config.Handlers[args.Capability]
  	if handler == nil {
  		pe.p.logger.Printf("[WARN] scada-client: requested capability '%s' not available",
  			args.Capability)
  		return fmt.Errorf("invalid capability")
  	}
  
  	// Hijack the connection
  	pe.setHijack(func(a io.ReadWriteCloser) {
  		if err := handler(args.Capability, args.Meta, a); err != nil {
  			pe.p.logger.Printf("[ERR] scada-client: '%s' handler error: %v",
  				args.Capability, err)
  		}
  	})
  	resp.Success = true
  	return nil
  }
docs: // Connect is invoked by the broker to connect to a capability