// ServerConfig returns a ZoneConfig with address information derived from s. func ServerConfig(s *room.Server) (*ZoneConfig, error) { zc := NewZoneConfig(s.Room()) err := zc.initAddr(s.Addr()) if err != nil { return nil, err } return zc, nil }
// RunDiscovery runs the discover server func RunDiscovery(ctx context.Context, server *room.Server) { log.Printf("[INFO] Server running at %s", server.Addr()) disco, err := roomdisco.NewDiscoverableServer(server) if err != nil { log.Printf("[FATAL] Discovery failed to start: %v", err) return } defer disco.Close() log.Printf("[INFO] Discovery server is running") <-ctx.Done() }