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
- SecurityRuntime.cs
- HttpResponseInternalWrapper.cs
- DataGridViewLayoutData.cs
- IDQuery.cs
- WebScriptEnablingElement.cs
- BaseCollection.cs
- Receive.cs
- ExpressionsCollectionConverter.cs
- HtmlElementEventArgs.cs
- BinaryFormatterWriter.cs
- UpdateCompiler.cs
- ServiceOperationUIEditor.cs
- IOThreadScheduler.cs
- OAVariantLib.cs
- RegexGroup.cs
- HttpModulesSection.cs
- ObjectStateManager.cs
- TextPattern.cs
- BinaryParser.cs
- CommandSet.cs
- EndPoint.cs
- FontEmbeddingManager.cs
- NonDualMessageSecurityOverHttp.cs
- CompilerParameters.cs
- SynchronousChannelMergeEnumerator.cs
- ControlsConfig.cs
- RectangleConverter.cs
- DecimalConstantAttribute.cs
- EdmValidator.cs
- OnOperation.cs
- WSMessageEncoding.cs
- EncodingStreamWrapper.cs
- CommandField.cs
- StaticContext.cs
- FilterRepeater.cs
- _PooledStream.cs
- ItemType.cs
- SchemaObjectWriter.cs
- OleDbConnectionFactory.cs
- _FtpDataStream.cs
- Semaphore.cs
- SqlUdtInfo.cs
- SinglePageViewer.cs
- GacUtil.cs
- ClaimTypeElementCollection.cs
- ActivationArguments.cs
- QueryOptionExpression.cs
- AdornerHitTestResult.cs
- TextEditorTyping.cs
- ListItem.cs
- AtomMaterializerLog.cs
- ThreadNeutralSemaphore.cs
- TypeElementCollection.cs
- IQueryable.cs
- HostingEnvironmentWrapper.cs
- SqlInfoMessageEvent.cs
- BinaryMessageFormatter.cs
- SkewTransform.cs
- VectorConverter.cs
- DataDocumentXPathNavigator.cs
- ObjectStateManager.cs
- SafeRightsManagementPubHandle.cs
- BrushConverter.cs
- KnownColorTable.cs
- OleTxTransactionInfo.cs
- SQlBooleanStorage.cs
- RuleRef.cs
- CategoryAttribute.cs
- ContextMenuService.cs
- TcpStreams.cs
- TrackingProfileSerializer.cs
- Animatable.cs
- LiteralTextParser.cs
- DivideByZeroException.cs
- AccessorTable.cs
- DataGridHeaderBorder.cs
- ProtocolsConfigurationHandler.cs
- TypedColumnHandler.cs
- ArraySortHelper.cs
- EventHandlerService.cs
- WarningException.cs
- GlyphingCache.cs
- MappedMetaModel.cs
- ServiceOperationUIEditor.cs
- IndependentlyAnimatedPropertyMetadata.cs
- XPathItem.cs
- ellipse.cs
- Track.cs
- EventBookmark.cs
- DictionarySectionHandler.cs
- TextBoxDesigner.cs
- COSERVERINFO.cs
- TypeUsage.cs
- Thickness.cs
- DataServiceProviderWrapper.cs
- WeakRefEnumerator.cs
- Set.cs
- SamlSerializer.cs
- SQLStringStorage.cs
- WsdlBuildProvider.cs