예제 #1
0
        /// <summary>
        /// Attempts to retrieve the user's statistics from the server.
        /// </summary>
        /// <param name="stats">The statistics of the user.</param>
        /// <returns>Null if the operation succeeds, or a <see cref="SerializedException"/>
        /// encapsulating the error that occured if the operation fails.</returns>
        public SerializedException GetUserStatistics(ref UserStatistics stats)
        {
            SerializedException sx = null;

            try
            {
                //WebServiceProxy proxy = WebServiceProxy.Instance();
                UserStatistics userstats = null;
                sx = proxy.SendUserStatistics(globals.Client_Info, out userstats);
                if (sx != null)
                {
                    log.LogError("An error occured while retrieving the statistics:" + sx.Message);
                    globals.FileLog.LogWarning("CrawlWave.Client: Failed to retrieve user's statistics: " + sx.Message);
                    stats = userstats;
                }
            }
            catch (Exception e)
            {
                log.LogWarning("An error occured while retrieving the statistics: " + e.Message);
                globals.FileLog.LogWarning("CrawlWave.Client: Failed to retrieve user's statistics: " + e.ToString());
                sx = new SerializedException(e.GetType().ToString(), e.Message, e.StackTrace);
            }
            finally
            {
                GC.Collect();
            }
            return(sx);
        }