예제 #1
0
        /// <summary>
        /// Callback function to process take's server' replies
        /// <param name="ar"A AsyncResult Delgate Object.</param>
        /// </summary>
        public static void CallbackTake(IAsyncResult ar)
        {
            RemoteAsyncTakeDelegate del = (RemoteAsyncTakeDelegate)((AsyncResult)ar).AsyncDelegate;

            lock (TakeLock)
            {
                _responseTake.Add(del.EndInvoke(ar));
                takeHandles[takeCounter++].Set();
                if (takeCounter == numServers)
                {
                    takeCounter = 0;
                }
            }
        }