Handle binding failures

This commit is contained in:
George 2020-09-25 19:55:01 -04:00
parent 042cefcc84
commit 16daa1032a

View File

@ -65,7 +65,11 @@ func (s *MeshnameServer) Start() error {
dns.HandleFunc(tld, s.handleRequest) dns.HandleFunc(tld, s.handleRequest)
s.log.Debugln("Handling:", tld, subnet) s.log.Debugln("Handling:", tld, subnet)
} }
go s.dnsServer.ListenAndServe() go func(){
if err := s.dnsServer.ListenAndServe(); err != nil {
s.log.Fatalln("MeshnameServer failed to start:", err)
}
}()
<-waitStarted <-waitStarted
s.log.Debugln("MeshnameServer started") s.log.Debugln("MeshnameServer started")