code: func (c *Chain) getConn() (conn net.Conn, err error) {
  	if c.IsEmpty() {
  		err = ErrEmptyChain
  		return
  	}
  	nodes := c.Nodes()
  	node := nodes[0]
  
  	cn, err := node.Client.Dial(node.Addr, node.DialOptions...)
  	if err != nil {
  		node.MarkDead()
  		return
  	}
  
  	cn, err = node.Client.Handshake(cn, node.HandshakeOptions...)
  	if err != nil {
  		node.MarkDead()
  		return
  	}
  	node.ResetDead()
  
  	preNode := node
  	for _, node := range nodes[1:] {
  		var cc net.Conn
  		cc, err = preNode.Client.Connect(cn, node.Addr)
  		if err != nil {
  			cn.Close()
  			node.MarkDead()
  			return
  		}
  		cc, err = node.Client.Handshake(cc, node.HandshakeOptions...)
  		if err != nil {
  			cn.Close()
  			node.MarkDead()
  			return
  		}
  		node.ResetDead()
  
  		cn = cc
  		preNode = node
  	}
  
  	conn = cn
  	return
  }
docs: // getConn obtains a connection to the last node of the chain.