1 Reply Latest reply on Feb 1, 2012 12:46 PM by cmanhard

    PISystem Refresh issue

    jagadeesh.macherla

      Hi Team,

       

      We are using the below code to refresh all the systems. As per our requirement, there is a list of servers, some of which are connected. If suppose one server is down, our requirement is to show all the other connected systems. I am using below code to get the list of connected servers.

       

       List<string> afServer = new List<string>();
       PISystems systems = new PISystems();
       systems.Refresh();
       foreach (PISystem server in systems)
       {
               afServer.Add(server.Name);
      }

       

       

       

      The issue is that if a server is down, then after refresh, it is showing error that "Can't connect to server :'serverName'". Our requirement is that it should skip the disconnected server but refresh other connected servers.

       

      Thanks,

       

       

        • Re: PISystem Refresh issue
          cmanhard

          PISystems.Refresh() will refresh the list of AF Servers and then execute a refresh on the all servers which it believes to be connected. Once an AF Server is connected, it will remain so until an error occurs attempting to communicate to it.  Unfortunately, in this case, it appears that it is the System.Refresh which is first detecting the communication loss.  There is an overload, PISystems.Refresh(false), which will refresh the list of AF Servers, but not execute individual PISystem.Refresh to each of the connected AF Servers.  This overload was first added in the AF 2.3 Client release.  You can use this method to circumvent the connection loss issue.