package server import ( "net" "strconv" "go.alanpearce.eu/x/listenfd" ) func (s *Server) serveTCP() error { s.log.Debug( "fallback listener", "addr", net.JoinHostPort(s.options.ListenAddress, strconv.Itoa(s.options.Port)), ) l, err := listenfd.GetListener(0, net.JoinHostPort(s.options.ListenAddress, strconv.Itoa(s.options.Port)), s.log.Named("tcp.listenfd"), ) if err != nil { return err } return s.server.Serve(l) }