Beispiel #1
0
 // Cria um ficheiro vazio no servidor de dados
 private Boolean CreateEmptyFileOnDataServer(string hostname, int port, string localFilename, String filename)
 {
     {
         IDataToMeta dateserver = (IDataToMeta)Activator.GetObject(
             typeof(IDataToMeta), "tcp://" + hostname + ":" + port + "/PADIConnection");
         try
         {
             dateserver.CreateEmptyFile(filename, localFilename);
             return(true);
         }
         catch (SocketException e)
         {
             Console.WriteLine("Dataserver unvailable");
             return(false);
         }
     }
 }
Beispiel #2
0
 //Solicitar a copia entre 2 dataservers
 private Boolean CopyFileBetweenServer(string srcHost, int srcPort, string destHost, int destPort, string srcLocalFilename, String destLocalFilename)
 {
     {
         IDataToMeta dateserver = (IDataToMeta)Activator.GetObject(
             typeof(IDataToMeta), "tcp://" + srcHost + ":" + srcPort + "/PADIConnection");
         try
         {
             dateserver.CopyFileToOtherData(srcLocalFilename, destLocalFilename, destHost, destPort);
             return(true);
         }
         catch (SocketException e)
         {
             Console.WriteLine("Dataserver unvailable");
             return(false);
         }
     }
 }
Beispiel #3
0
        private ICollection <LocalFileStatistics> GetServerStatistics(String ip, int port)
        {
            IDataToMeta dataServer = (IDataToMeta)Activator.GetObject(
                typeof(IDataToMeta),
                "tcp://" + ip + ":" + port + "/PADIConnection");

            ICollection <LocalFileStatistics> r;

            try
            {
                r = dataServer.GetFileStatistics( ).Values;
            }
            catch (Exception)
            {
                return(null);
            }

            return(r);
        }