Ejemplo n.º 1
0
        public void OnJobStarted(GalaxyJobStartInfo jobStartInfo)
        {
            if (!m_fReady)
            {
                return;
            }

            if (JobStartCallBack != null)
            {
                Delegate[]  invokeList = JobStartCallBack.GetInvocationList();
                IEnumerator ie         = invokeList.GetEnumerator();
                while (ie.MoveNext())
                {
                    JobStartEventHandler jobStartListener = ie.Current as JobStartEventHandler;
                    try
                    {
                        jobStartListener.BeginInvoke(jobStartInfo, null, null);
                    }
                    catch (Exception)
                    {
                        JobStartCallBack -= jobStartListener;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <returns>
        ///     -1 - something wrong
        ///     0 - successfully
        ///     1 - job agent is offline
        /// </returns>
        public int AppendJobRequest(GalaxyJobStartInfo jobStartInfo)
        {
            int iRet = 0;

            if (m_jobAgent == null)
            {
                return(-1);
            }
            try
            {
                iRet = m_jobAgent.AppendJobRequest(jobStartInfo);
                if (iRet != 0)
                {
                    iRet = -1;
                }
            }
            catch (System.Net.Sockets.SocketException)
            {
                iRet = 1;
            }
            catch (Exception)
            {
                iRet = -1;
            }
            return(iRet);
        }