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
- StopRoutingHandler.cs
- KeyTime.cs
- Misc.cs
- ObjectSet.cs
- NetCodeGroup.cs
- CellParaClient.cs
- CompilerCollection.cs
- InvalidOleVariantTypeException.cs
- HandlerMappingMemo.cs
- CompiledELinqQueryState.cs
- GraphicsContext.cs
- AssertFilter.cs
- MouseWheelEventArgs.cs
- SqlDependencyListener.cs
- Primitive.cs
- ServiceHostingEnvironment.cs
- XmlSiteMapProvider.cs
- ErrorHandlerModule.cs
- Walker.cs
- ValidationErrorInfo.cs
- ButtonFieldBase.cs
- Expressions.cs
- ToolStripManager.cs
- DelayedRegex.cs
- SqlBuilder.cs
- InputBinder.cs
- DataColumnChangeEvent.cs
- Root.cs
- ProtocolElement.cs
- EasingQuaternionKeyFrame.cs
- AncillaryOps.cs
- XmlParser.cs
- OleDbDataAdapter.cs
- WebPartDescription.cs
- UpDownBase.cs
- ServiceDefaults.cs
- ColorContextHelper.cs
- DoubleLink.cs
- BindingValueChangedEventArgs.cs
- DbDeleteCommandTree.cs
- WebPartZoneBaseDesigner.cs
- BeginStoryboard.cs
- XPathMultyIterator.cs
- ConnectionStringSettingsCollection.cs
- NetPeerTcpBinding.cs
- Compiler.cs
- JsonStringDataContract.cs
- Tracer.cs
- AdCreatedEventArgs.cs
- ClientClassGenerator.cs
- SrgsOneOf.cs
- PolyLineSegmentFigureLogic.cs
- InstanceDescriptor.cs
- LinearGradientBrush.cs
- ComAdminInterfaces.cs
- BasicExpandProvider.cs
- UnmanagedBitmapWrapper.cs
- ProfileServiceManager.cs
- BuildResult.cs
- DiscoveryServiceExtension.cs
- RuleConditionDialog.cs
- MediaScriptCommandRoutedEventArgs.cs
- StorageEntityTypeMapping.cs
- ConstantCheck.cs
- WebPartUtil.cs
- UserValidatedEventArgs.cs
- DrawingState.cs
- Grant.cs
- EpmCustomContentWriterNodeData.cs
- M3DUtil.cs
- ParseElement.cs
- JournalNavigationScope.cs
- SerializerProvider.cs
- OleDbReferenceCollection.cs
- DragEvent.cs
- EnumConverter.cs
- XmlSerializer.cs
- AppDomainProtocolHandler.cs
- OracleConnectionString.cs
- SecurityDocument.cs
- PropertyGeneratedEventArgs.cs
- SplitterEvent.cs
- Style.cs
- AdditionalEntityFunctions.cs
- ListBindingHelper.cs
- BlockUIContainer.cs
- Storyboard.cs
- DesignerView.cs
- DesignerActionVerbItem.cs
- RightsManagementPermission.cs
- ExecutionContext.cs
- RuleSettings.cs
- WebRequestModuleElementCollection.cs
- DataGridViewAdvancedBorderStyle.cs
- BrowserDefinitionCollection.cs
- DataControlFieldsEditor.cs
- ResourceContainerWrapper.cs
- LZCodec.cs
- SectionXmlInfo.cs
- DataService.cs