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
- ItemsControlAutomationPeer.cs
- Funcletizer.cs
- BooleanConverter.cs
- ListViewAutomationPeer.cs
- RectangleGeometry.cs
- ClientSponsor.cs
- XmlRootAttribute.cs
- webbrowsersite.cs
- WebEventTraceProvider.cs
- SqlAggregateChecker.cs
- DataGridViewCellMouseEventArgs.cs
- StylusEditingBehavior.cs
- Compiler.cs
- CodeGen.cs
- ErrorWebPart.cs
- ChoiceConverter.cs
- DiscoveryExceptionDictionary.cs
- SiteMapHierarchicalDataSourceView.cs
- MouseActionValueSerializer.cs
- _NestedMultipleAsyncResult.cs
- WpfPayload.cs
- Walker.cs
- OleDbPropertySetGuid.cs
- XPathArrayIterator.cs
- RegexCompilationInfo.cs
- DataGridItemEventArgs.cs
- PopupRoot.cs
- TypeTypeConverter.cs
- StyleSelector.cs
- MenuItemCollection.cs
- PropertyGrid.cs
- TreeViewDesigner.cs
- SafeFileMappingHandle.cs
- ProcessModelSection.cs
- Publisher.cs
- ToolStripLabel.cs
- DataGridTextBox.cs
- CalloutQueueItem.cs
- NameValuePair.cs
- XmlSignatureManifest.cs
- AutoResizedEvent.cs
- TypeConverterHelper.cs
- PrintDocument.cs
- CompoundFileStorageReference.cs
- XPathBinder.cs
- XPathAncestorQuery.cs
- HtmlString.cs
- ContentHostHelper.cs
- GB18030Encoding.cs
- ByteAnimationBase.cs
- DataGridViewHitTestInfo.cs
- TrackingAnnotationCollection.cs
- Error.cs
- ListViewDeleteEventArgs.cs
- DodSequenceMerge.cs
- ChildTable.cs
- Point4DConverter.cs
- OracleDataReader.cs
- UserControlBuildProvider.cs
- SimpleRecyclingCache.cs
- NotFiniteNumberException.cs
- SchemaTableOptionalColumn.cs
- FormViewModeEventArgs.cs
- SystemColors.cs
- XmlChildNodes.cs
- XmlNotation.cs
- HttpListenerElement.cs
- SoapProtocolReflector.cs
- ObjectDataSourceFilteringEventArgs.cs
- EventlogProvider.cs
- BaseTemplateCodeDomTreeGenerator.cs
- StaticSiteMapProvider.cs
- Header.cs
- Menu.cs
- NativeCompoundFileAPIs.cs
- ExpressionWriter.cs
- InvalidateEvent.cs
- RequestQueue.cs
- DataGridTableCollection.cs
- DataRelationCollection.cs
- CommonDialog.cs
- AssociationType.cs
- Registry.cs
- TreeNodeCollection.cs
- XsltSettings.cs
- TextAdaptor.cs
- StylusPointPropertyInfo.cs
- TextCollapsingProperties.cs
- Line.cs
- ClientProxyGenerator.cs
- BindingContext.cs
- ZipPackage.cs
- XmlSchemaAttributeGroupRef.cs
- XPathDescendantIterator.cs
- ReachDocumentReferenceCollectionSerializerAsync.cs
- SettingsSavedEventArgs.cs
- HMACMD5.cs
- Underline.cs
- ServiceBehaviorAttribute.cs
- PropertyOrder.cs