Beispiel #1
0
                public void SetIdleConfiguration(cIdleConfiguration pConfiguration, cTrace.cContext pParentContext)
                {
                    var lContext = pParentContext.NewMethod(nameof(cCommandPipeline), nameof(SetIdleConfiguration), pConfiguration);

                    if (mDisposed)
                    {
                        throw new ObjectDisposedException(nameof(cCommandPipeline));
                    }
                    mIdleConfiguration = pConfiguration;
                    mBackgroundReleaser.Release(lContext);
                }
Beispiel #2
0
                private async Task ZIdleAsync(cIdleConfiguration pIdleConfiguration, cTrace.cContext pParentContext)
                {
                    var lContext = pParentContext.NewMethod(nameof(cCommandPipeline), nameof(ZIdleAsync));

                    if (!await ZIdleDelayAsync(pIdleConfiguration.StartDelay, lContext).ConfigureAwait(false))
                    {
                        return;
                    }

                    if (mIdleCommandSupported)
                    {
                        await ZIdleIdleAsync(pIdleConfiguration.IdleRestartInterval, lContext).ConfigureAwait(false);
                    }
                    else
                    {
                        await ZIdlePollAsync(pIdleConfiguration.PollInterval, lContext).ConfigureAwait(false);
                    }
                }
Beispiel #3
0
                public cCommandPipeline(cCallbackSynchroniser pSynchroniser, Action <cTrace.cContext> pDisconnected, cBatchSizerConfiguration pNetworkWriteConfiguration, cIdleConfiguration pIdleConfiguration, cTrace.cContext pParentContext)
                {
                    var lContext = pParentContext.NewObject(nameof(cCommandPipeline), pIdleConfiguration);

                    mSynchroniser = pSynchroniser ?? throw new ArgumentNullException(nameof(pSynchroniser));
                    mDisconnected = pDisconnected ?? throw new ArgumentNullException(nameof(pDisconnected));
                    if (pNetworkWriteConfiguration == null)
                    {
                        throw new ArgumentNullException(nameof(pNetworkWriteConfiguration));
                    }
                    mConnection        = new cConnection(pNetworkWriteConfiguration);
                    mIdleConfiguration = pIdleConfiguration;

                    mResponseTextProcessor = new cResponseTextProcessor(pSynchroniser);

                    // these depend on the cancellationtokensource being constructed
                    mBackgroundReleaser = new cReleaser("commandpipeline_background", mBackgroundCancellationTokenSource.Token);
                    mBackgroundAwaiter  = new cAwaiter(mBackgroundCancellationTokenSource.Token);

                    mBackgroundSendBuffer = new cSendBuffer(pSynchroniser, mConnection, mBackgroundCancellationTokenSource.Token);

                    // plumbing
                    mIdleBlock.Released += mBackgroundReleaser.Release; // when the idle block is removed, kick the background process
                }
Beispiel #4
0
            // (note for when adding more: they need to be disposed)

            public cSession(cCallbackSynchroniser pSynchroniser, fCapabilities pIgnoreCapabilities, fMailboxCacheDataItems pMailboxCacheDataItems, cBatchSizerConfiguration pNetworkWriteConfiguration, cIdleConfiguration pIdleConfiguration, cBatchSizerConfiguration pFetchCacheItemsConfiguration, cBatchSizerConfiguration pFetchBodyReadConfiguration, Encoding pEncoding, cTrace.cContext pParentContext)
            {
                var lContext = pParentContext.NewObject(nameof(cSession), pIgnoreCapabilities, pMailboxCacheDataItems, pNetworkWriteConfiguration, pIdleConfiguration, pFetchCacheItemsConfiguration, pFetchBodyReadConfiguration);

                mSynchroniser          = pSynchroniser ?? throw new ArgumentNullException(nameof(pSynchroniser));
                mIgnoreCapabilities    = pIgnoreCapabilities;
                mMailboxCacheDataItems = pMailboxCacheDataItems;

                mPipeline = new cCommandPipeline(pSynchroniser, ZDisconnected, pNetworkWriteConfiguration, pIdleConfiguration, lContext);

                mFetchCacheItemsSizer = new cBatchSizer(pFetchCacheItemsConfiguration);
                mFetchBodyReadSizer   = new cBatchSizer(pFetchBodyReadConfiguration);

                mCommandPartFactory = new cCommandPartFactory(false, null);

                if (pEncoding == null)
                {
                    mEncodingPartFactory = mCommandPartFactory;
                }
                else
                {
                    mEncodingPartFactory = new cCommandPartFactory(false, pEncoding);
                }
            }
Beispiel #5
0
            public void SetIdleConfiguration(cIdleConfiguration pConfiguration, cTrace.cContext pParentContext)
            {
                var lContext = pParentContext.NewMethod(nameof(cSession), nameof(SetIdleConfiguration), pConfiguration);

                mPipeline.SetIdleConfiguration(pConfiguration, lContext);
            }