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
- DecoderReplacementFallback.cs
- ClaimSet.cs
- XmlSchemaInfo.cs
- ActiveXHost.cs
- RowUpdatingEventArgs.cs
- SmiEventSink_Default.cs
- InputGestureCollection.cs
- FastEncoder.cs
- ActivationServices.cs
- DeclarationUpdate.cs
- SecurityException.cs
- ColorPalette.cs
- RouteValueExpressionBuilder.cs
- Logging.cs
- ExpressionHelper.cs
- FormatVersion.cs
- BindStream.cs
- CorrelationTokenInvalidatedHandler.cs
- NameValueConfigurationCollection.cs
- securitycriticaldataClass.cs
- ToolStripCodeDomSerializer.cs
- DataSourceView.cs
- SoapReflectionImporter.cs
- DrawingGroup.cs
- Exceptions.cs
- PropertyGridView.cs
- InputGestureCollection.cs
- TableFieldsEditor.cs
- TextEndOfSegment.cs
- PageParserFilter.cs
- TextBox.cs
- XmlSerializerSection.cs
- ObjectItemCachedAssemblyLoader.cs
- WindowsToolbarAsMenu.cs
- FileDetails.cs
- TypeSystem.cs
- InternalRelationshipCollection.cs
- SqlAggregateChecker.cs
- IfAction.cs
- FixedSOMTable.cs
- ServiceHttpModule.cs
- SecurityTokenSerializer.cs
- counter.cs
- PrintDialogDesigner.cs
- VideoDrawing.cs
- EncryptedData.cs
- ObjectReaderCompiler.cs
- SystemResourceKey.cs
- EmulateRecognizeCompletedEventArgs.cs
- TextDecorationCollectionConverter.cs
- RootProfilePropertySettingsCollection.cs
- DataGridViewColumnHeaderCell.cs
- Ray3DHitTestResult.cs
- ZipIOLocalFileHeader.cs
- ImageCodecInfoPrivate.cs
- ThreadLocal.cs
- BitmapEffectDrawingContent.cs
- DataGridViewCellMouseEventArgs.cs
- OdbcEnvironment.cs
- PublishLicense.cs
- StyleCollectionEditor.cs
- NetworkInformationException.cs
- PathHelper.cs
- cookiecontainer.cs
- ConstraintConverter.cs
- MyContact.cs
- CornerRadiusConverter.cs
- ISCIIEncoding.cs
- CursorConverter.cs
- InstanceCompleteException.cs
- followingquery.cs
- CounterSetInstance.cs
- TextTreeFixupNode.cs
- Margins.cs
- ProfileParameter.cs
- DataGridHeaderBorder.cs
- SoapParser.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- MetadataCacheItem.cs
- WorkflowViewService.cs
- PropertyKey.cs
- DomainUpDown.cs
- XmlILTrace.cs
- DashStyle.cs
- GridViewUpdatedEventArgs.cs
- CodeNamespaceCollection.cs
- IpcClientManager.cs
- Decimal.cs
- ConnectionStringSettingsCollection.cs
- LayoutDump.cs
- HashHelper.cs
- XmlSchemaRedefine.cs
- NetNamedPipeSecurityElement.cs
- SchemaElement.cs
- ConnectionStringSettings.cs
- CompilerError.cs
- ParserExtension.cs
- ConfigPathUtility.cs
- OTFRasterizer.cs
- ObservableDictionary.cs