Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / DetectEofStream.cs / 1 / DetectEofStream.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System.IO; abstract class DetectEofStream : DelegatingStream { bool isAtEof; protected DetectEofStream(Stream stream) : base(stream) { this.isAtEof = false; } protected bool IsAtEof { get { return this.isAtEof; } } public override int EndRead(IAsyncResult result) { int returnValue = base.EndRead(result); if (returnValue == 0) { ReceivedEof(); } return returnValue; } public override int ReadByte() { int returnValue = base.ReadByte(); if (returnValue == -1) { ReceivedEof(); } return returnValue; } public override int Read(byte[] buffer, int offset, int count) { int returnValue = base.Read(buffer, offset, count); if (returnValue == 0) { ReceivedEof(); } return returnValue; } void ReceivedEof() { if (!isAtEof) { this.isAtEof = true; this.OnReceivedEof(); } } protected virtual void OnReceivedEof() { } } } // 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
- DeviceContext.cs
- TimersDescriptionAttribute.cs
- PnrpPermission.cs
- DoubleLink.cs
- ToolStripItemImageRenderEventArgs.cs
- ResourceDisplayNameAttribute.cs
- TextChangedEventArgs.cs
- TableCellsCollectionEditor.cs
- CalendarModeChangedEventArgs.cs
- PointCollectionValueSerializer.cs
- NoResizeSelectionBorderGlyph.cs
- MimeMapping.cs
- DataGridViewAccessibleObject.cs
- WindowsAuthenticationModule.cs
- StdValidatorsAndConverters.cs
- FlowDecisionDesigner.xaml.cs
- OneWayChannelFactory.cs
- ConstraintEnumerator.cs
- ThicknessAnimation.cs
- CodeCompileUnit.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ToggleButtonAutomationPeer.cs
- HandlerBase.cs
- DataServiceContext.cs
- ErrorStyle.cs
- FaultHandlingFilter.cs
- WebProxyScriptElement.cs
- VisualStateChangedEventArgs.cs
- xmlsaver.cs
- TimelineGroup.cs
- OrderedDictionary.cs
- ColumnCollection.cs
- ConnectionProviderAttribute.cs
- HandleTable.cs
- SecurityRuntime.cs
- SystemColors.cs
- LogicalCallContext.cs
- HtmlMeta.cs
- RawTextInputReport.cs
- SpeechSeg.cs
- MessageBox.cs
- MergeLocalizationDirectives.cs
- OlePropertyStructs.cs
- DBDataPermissionAttribute.cs
- TextEditorSpelling.cs
- Binding.cs
- IsolatedStorageException.cs
- BaseAsyncResult.cs
- RectConverter.cs
- TextContainer.cs
- AnonymousIdentificationSection.cs
- ResourcePool.cs
- PageThemeParser.cs
- ConnectionOrientedTransportElement.cs
- Compress.cs
- ExpressionPrinter.cs
- GridEntryCollection.cs
- CardSpaceSelector.cs
- FixedPageAutomationPeer.cs
- SelectionItemProviderWrapper.cs
- UIInitializationException.cs
- DataGridViewHeaderCell.cs
- SqlCaseSimplifier.cs
- IncrementalCompileAnalyzer.cs
- NodeFunctions.cs
- DeflateStream.cs
- ServerProtocol.cs
- EventTrigger.cs
- KeyFrames.cs
- ExpandoClass.cs
- NamespaceInfo.cs
- XamlGridLengthSerializer.cs
- Camera.cs
- AccessDataSourceView.cs
- FontFamily.cs
- DrawingVisual.cs
- DataObjectFieldAttribute.cs
- AQNBuilder.cs
- HttpModuleActionCollection.cs
- RouteItem.cs
- DataKeyCollection.cs
- DocumentSequence.cs
- BufferBuilder.cs
- ModifierKeysConverter.cs
- InheritanceContextChangedEventManager.cs
- ExpressionEditorAttribute.cs
- Select.cs
- XmlElementAttributes.cs
- RawUIStateInputReport.cs
- ContextStaticAttribute.cs
- Tablet.cs
- IgnoreDataMemberAttribute.cs
- RootProfilePropertySettingsCollection.cs
- MemberMaps.cs
- CorrelationManager.cs
- FactoryMaker.cs
- DateTimeOffsetConverter.cs
- CellCreator.cs
- Attributes.cs
- DeferredElementTreeState.cs