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
- AutoGeneratedFieldProperties.cs
- ProfessionalColors.cs
- DecoderNLS.cs
- DefaultBindingPropertyAttribute.cs
- BitmapEffect.cs
- ControlParser.cs
- FlowPanelDesigner.cs
- ColumnCollection.cs
- CodeExpressionCollection.cs
- RevocationPoint.cs
- DuplicateDetector.cs
- ImageField.cs
- MILUtilities.cs
- Parameter.cs
- TranslateTransform3D.cs
- FileVersion.cs
- HwndAppCommandInputProvider.cs
- PointHitTestResult.cs
- ObjectQuery.cs
- CSharpCodeProvider.cs
- RoleGroup.cs
- HtmlHead.cs
- pingexception.cs
- BasicBrowserDialog.cs
- TextEditorTables.cs
- ValueTypeFixupInfo.cs
- GetPageCompletedEventArgs.cs
- Transactions.cs
- SiteMapNode.cs
- GcHandle.cs
- EventEntry.cs
- ActivityWithResultValueSerializer.cs
- ChannelManagerService.cs
- WindowsListViewItem.cs
- ActivityXRefConverter.cs
- SymDocumentType.cs
- DataStorage.cs
- ClientSideProviderDescription.cs
- SqlRowUpdatedEvent.cs
- Variable.cs
- DbgUtil.cs
- TableProvider.cs
- ReadOnlyDictionary.cs
- ColorConvertedBitmap.cs
- ErrorCodes.cs
- XhtmlBasicPanelAdapter.cs
- TimelineGroup.cs
- BinaryHeap.cs
- LocalFileSettingsProvider.cs
- DesignerCommandAdapter.cs
- TypedElement.cs
- OdbcCommandBuilder.cs
- ProcessHostMapPath.cs
- FrameworkContentElement.cs
- CrossContextChannel.cs
- SqlNamer.cs
- SchemaEntity.cs
- LineSegment.cs
- GPPOINTF.cs
- EventLogEntry.cs
- XmlSchemaDatatype.cs
- FastEncoderWindow.cs
- FragmentQueryProcessor.cs
- TypeExtension.cs
- XmlSchemaSimpleContent.cs
- EventMappingSettingsCollection.cs
- XmlEntityReference.cs
- ExpressionBindingCollection.cs
- ReadOnlyDataSourceView.cs
- xmlglyphRunInfo.cs
- AmbientProperties.cs
- DataGridViewHitTestInfo.cs
- Assign.cs
- DesignSurface.cs
- RequiredFieldValidator.cs
- Compilation.cs
- ServerValidateEventArgs.cs
- PropertyManager.cs
- ContractBase.cs
- DbReferenceCollection.cs
- Itemizer.cs
- LongValidatorAttribute.cs
- SynchronizedReadOnlyCollection.cs
- ObjectQueryState.cs
- ListViewPagedDataSource.cs
- SafeProcessHandle.cs
- AutoResizedEvent.cs
- XMLSchema.cs
- CodeChecksumPragma.cs
- HwndProxyElementProvider.cs
- SignerInfo.cs
- DirectoryInfo.cs
- ProxySimple.cs
- Clipboard.cs
- SecurityUniqueId.cs
- StyleModeStack.cs
- EventDriven.cs
- PathSegmentCollection.cs
- BinHexEncoding.cs
- HierarchicalDataSourceControl.cs