+
+ // Register callback on Connection
+ svr.ConnectOn(func(server *XdsServer) error {
+
+ // Add server to list
+ s.xdsServers[server.ID] = svr
+
+ // Register event forwarder
+ if err := s.sdksEventsForwardInit(server); err != nil {
+ s.Log.Errorf("XDS Server %v - sdk event forwarding error: %v", server.ID, err)
+ }
+
+ // Load projects
+ if err := s.projects.Init(server); err != nil {
+ s.Log.Errorf("XDS Server %v - project init error: %v", server.ID, err)
+ }
+
+ // Registered to all events
+ if err := server.EventRegister(xsapiv1.EVTAll, ""); err != nil {
+ s.Log.Errorf("XDS Server %v - register all events error: %v", server.ID, err)
+ }
+
+ return nil
+ })