code: func newTCPListener(address string, port uint32, ch chan *net.TCPConn) (*tcpListener, error) {
  	proto := "tcp4"
  	if ip := net.ParseIP(address); ip == nil {
  		return nil, fmt.Errorf("can't listen on %s", address)
  	} else if ip.To4() == nil {
  		proto = "tcp6"
  	}
  	addr, err := net.ResolveTCPAddr(proto, net.JoinHostPort(address, strconv.Itoa(int(port))))
  	if err != nil {
  		return nil, err
  	}
  
  	l, err := net.ListenTCP(proto, addr)
  	if err != nil {
  		return nil, err
  	}
  	// Note: Set TTL=255 for incoming connection listener in order to accept
  	// connection in case for the neighbor has TTL Security settings.
  	if err := setListenTCPTTLSockopt(l, 255); err != nil {
  		log.WithFields(log.Fields{
  			"Topic": "Peer",
  			"Key":   addr,
  		}).Warnf("cannot set TTL(=%d) for TCPListener: %s", 255, err)
  	}
  
  	closeCh := make(chan struct{})
  	go func() error {
  		for {
  			conn, err := l.AcceptTCP()
  			if err != nil {
  				close(closeCh)
  				log.WithFields(log.Fields{
  					"Topic": "Peer",
  					"Error": err,
  				}).Warn("Failed to AcceptTCP")
  				return err
  			}
  			ch <- conn
  		}
  	}()
  	return &tcpListener{
  		l:  l,
  		ch: closeCh,
  	}, nil
  }
docs: // avoid mapped IPv6 address