예제 #1
0
        public AsyncResult begin_flushBatchRequests(AsyncCallback cb, object cookie)
        {
            IceInternal.OutgoingConnectionFactory connectionFactory = instance_.outgoingConnectionFactory();
            IceInternal.ObjectAdapterFactory adapterFactory = instance_.objectAdapterFactory();

            //
            // This callback object receives the results of all invocations
            // of Connection.begin_flushBatchRequests.
            //
            IceInternal.CommunicatorFlushBatch result =
                new IceInternal.CommunicatorFlushBatch(this, instance_, __flushBatchRequests_name, cookie);

            if(cb != null)
            {
                result.whenCompletedWithAsyncCallback(cb);
            }

            connectionFactory.flushAsyncBatchRequests(result);
            adapterFactory.flushAsyncBatchRequests(result);

            //
            // Inform the callback that we have finished initiating all of the
            // flush requests. If all of the requests have already completed,
            // the callback is invoked now.
            //
            result.ready();

            return result;
        }