code: func (s *Server) handleConn(conn net.Conn, isTLS bool) {
  	// Read a single byte
  	buf := make([]byte, 1)
  	if _, err := conn.Read(buf); err != nil {
  		if err != io.EOF {
  			s.logger.Printf("[ERR] consul.rpc: failed to read byte: %v %s", err, logConn(conn))
  		}
  		conn.Close()
  		return
  	}
  	typ := pool.RPCType(buf[0])
  
  	// Enforce TLS if VerifyIncoming is set
  	if s.config.VerifyIncoming && !isTLS && typ != pool.RPCTLS {
  		s.logger.Printf("[WARN] consul.rpc: Non-TLS connection attempted with VerifyIncoming set %s", logConn(conn))
  		conn.Close()
  		return
  	}
  
  	// Switch on the byte
  	switch typ {
  	case pool.RPCConsul:
  		s.handleConsulConn(conn)
  
  	case pool.RPCRaft:
  		metrics.IncrCounter([]string{"rpc", "raft_handoff"}, 1)
  		s.raftLayer.Handoff(conn)
  
  	case pool.RPCTLS:
  		if s.rpcTLS == nil {
  			s.logger.Printf("[WARN] consul.rpc: TLS connection attempted, server not configured for TLS %s", logConn(conn))
  			conn.Close()
  			return
  		}
  		conn = tls.Server(conn, s.rpcTLS)
  		s.handleConn(conn, true)
  
  	case pool.RPCMultiplexV2:
  		s.handleMultiplexV2(conn)
  
  	case pool.RPCSnapshot:
  		s.handleSnapshotConn(conn)
  
  	default:
  		if !s.handleEnterpriseRPCConn(typ, conn, isTLS) {
  			s.logger.Printf("[ERR] consul.rpc: unrecognized RPC byte: %v %s", typ, logConn(conn))
  			conn.Close()
  		}
  	}
  }
docs: // handleConn is used to determine if this is a Raft or
  // Consul type RPC connection and invoke the correct handler