Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / InputQueueChannelAcceptor.cs / 1 / InputQueueChannelAcceptor.cs
//----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------
namespace System.ServiceModel.Channels
{
class InputQueueChannelAcceptor : ChannelAcceptor
where TChannel : class, IChannel
{
InputQueue channelQueue;
public InputQueueChannelAcceptor(ChannelManagerBase channelManager)
: base(channelManager)
{
this.channelQueue = new InputQueue();
}
public int PendingCount
{
get { return this.channelQueue.PendingCount; }
}
public override TChannel AcceptChannel(TimeSpan timeout)
{
this.ThrowIfNotOpened();
return this.channelQueue.Dequeue(timeout);
}
public override IAsyncResult BeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state)
{
this.ThrowIfNotOpened();
return this.channelQueue.BeginDequeue(timeout, callback, state);
}
public void Dispatch()
{
this.channelQueue.Dispatch();
}
public override TChannel EndAcceptChannel(IAsyncResult result)
{
return this.channelQueue.EndDequeue(result);
}
public void EnqueueAndDispatch(TChannel channel)
{
this.channelQueue.EnqueueAndDispatch(channel);
}
public void EnqueueAndDispatch(TChannel channel, ItemDequeuedCallback dequeuedCallback)
{
this.channelQueue.EnqueueAndDispatch(channel, dequeuedCallback);
}
public bool EnqueueWithoutDispatch(TChannel channel, ItemDequeuedCallback dequeuedCallback)
{
return this.channelQueue.EnqueueWithoutDispatch(channel, dequeuedCallback);
}
public virtual bool EnqueueWithoutDispatch(Exception exception, ItemDequeuedCallback dequeuedCallback)
{
return this.channelQueue.EnqueueWithoutDispatch(exception, dequeuedCallback);
}
public void EnqueueAndDispatch(TChannel channel, ItemDequeuedCallback dequeuedCallback, bool canDispatchOnThisThread)
{
this.channelQueue.EnqueueAndDispatch(channel, dequeuedCallback, canDispatchOnThisThread);
}
public virtual void EnqueueAndDispatch(Exception exception, ItemDequeuedCallback dequeuedCallback, bool canDispatchOnThisThread)
{
this.channelQueue.EnqueueAndDispatch(exception, dequeuedCallback, canDispatchOnThisThread);
}
public void FaultQueue()
{
this.Fault();
}
protected override void OnClosed()
{
base.OnClosed();
this.channelQueue.Dispose();
}
protected override void OnFaulted()
{
this.channelQueue.Shutdown(this.ChannelManager);
base.OnFaulted();
}
public override bool WaitForChannel(TimeSpan timeout)
{
this.ThrowIfNotOpened();
return this.channelQueue.WaitForItem(timeout);
}
public override IAsyncResult BeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state)
{
this.ThrowIfNotOpened();
return this.channelQueue.BeginWaitForItem(timeout, callback, state);
}
public override bool EndWaitForChannel(IAsyncResult result)
{
return this.channelQueue.EndWaitForItem(result);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ManagementException.cs
- MD5HashHelper.cs
- StatementContext.cs
- OrderByBuilder.cs
- ComIntegrationManifestGenerator.cs
- PropertyHelper.cs
- ConcurrentBag.cs
- OleDbEnumerator.cs
- CollaborationHelperFunctions.cs
- SqlCacheDependency.cs
- Propagator.cs
- Memoizer.cs
- WsatServiceCertificate.cs
- EpmSyndicationContentSerializer.cs
- DataFormats.cs
- WebPartZoneCollection.cs
- ObjectDataSourceEventArgs.cs
- _HeaderInfoTable.cs
- TemplatedAdorner.cs
- WmlImageAdapter.cs
- _FtpDataStream.cs
- RuntimeHandles.cs
- ProvidersHelper.cs
- BitConverter.cs
- DataControlCommands.cs
- ServerValidateEventArgs.cs
- ClientFormsIdentity.cs
- ToolStripDropDown.cs
- ListItemCollection.cs
- ComplexBindingPropertiesAttribute.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ListBoxItem.cs
- TimeManager.cs
- CompositionAdorner.cs
- WhitespaceSignificantCollectionAttribute.cs
- SwitchLevelAttribute.cs
- ErrorTableItemStyle.cs
- TemplateComponentConnector.cs
- DataServiceProcessingPipeline.cs
- NamedObject.cs
- PerformanceCounterCategory.cs
- EncoderParameter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ColorPalette.cs
- IOThreadTimer.cs
- CodeParameterDeclarationExpression.cs
- QueryCursorEventArgs.cs
- GeometryConverter.cs
- BasicCellRelation.cs
- EventProperty.cs
- RuntimeCompatibilityAttribute.cs
- Cursors.cs
- ISessionStateStore.cs
- UnsafeNativeMethodsMilCoreApi.cs
- CompModHelpers.cs
- FixedPosition.cs
- listviewsubitemcollectioneditor.cs
- ColorConvertedBitmap.cs
- AttributeQuery.cs
- ConfigsHelper.cs
- XsdDuration.cs
- XmlMapping.cs
- BinaryObjectInfo.cs
- BaseCodePageEncoding.cs
- ClientSettings.cs
- HttpPostedFileWrapper.cs
- PackageDigitalSignature.cs
- DataGridViewMethods.cs
- HtmlLink.cs
- DataPagerFieldCommandEventArgs.cs
- ToolStripCustomTypeDescriptor.cs
- ReadOnlyHierarchicalDataSourceView.cs
- RelatedPropertyManager.cs
- Calendar.cs
- XamlSerializer.cs
- WebPartHeaderCloseVerb.cs
- ListSourceHelper.cs
- BinaryConverter.cs
- SecurityAttributeGenerationHelper.cs
- ConfigurationManagerInternal.cs
- LinkedList.cs
- DataGridAutoFormatDialog.cs
- InputScopeNameConverter.cs
- DesignerTransaction.cs
- SessionState.cs
- WebPartCatalogCloseVerb.cs
- SafeCryptHandles.cs
- FontInfo.cs
- PopOutPanel.cs
- DocumentsTrace.cs
- Deserializer.cs
- AspProxy.cs
- StaticTextPointer.cs
- SourceLineInfo.cs
- XamlFilter.cs
- SmtpLoginAuthenticationModule.cs
- ResXBuildProvider.cs
- CodeParameterDeclarationExpression.cs
- webclient.cs
- KeyValueSerializer.cs