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
- MessageHeaderAttribute.cs
- X509Utils.cs
- LayoutEngine.cs
- BasePattern.cs
- WorkflowApplicationAbortedException.cs
- InProcStateClientManager.cs
- Faults.cs
- MLangCodePageEncoding.cs
- IChannel.cs
- AsyncPostBackTrigger.cs
- CompositeScriptReference.cs
- Error.cs
- PopOutPanel.cs
- RemotingException.cs
- Site.cs
- safelinkcollection.cs
- EnumerableWrapperWeakToStrong.cs
- RtfNavigator.cs
- StateDesigner.Helpers.cs
- BamlRecordWriter.cs
- ECDsaCng.cs
- TextEditorCharacters.cs
- GeneralTransformGroup.cs
- DesignerDataConnection.cs
- PropVariant.cs
- BaseInfoTable.cs
- UIElementPropertyUndoUnit.cs
- PhysicalOps.cs
- UserUseLicenseDictionaryLoader.cs
- Certificate.cs
- DataColumnMapping.cs
- StrongNameKeyPair.cs
- PropertyTab.cs
- RadioButtonList.cs
- CodeTypeParameterCollection.cs
- IndicFontClient.cs
- BrowserPolicyValidator.cs
- RoutedEventHandlerInfo.cs
- FontFamilyConverter.cs
- TextEditorCopyPaste.cs
- StructuredTypeEmitter.cs
- SSmlParser.cs
- InkCanvasFeedbackAdorner.cs
- SemaphoreFullException.cs
- DropShadowEffect.cs
- WindowsTitleBar.cs
- RsaEndpointIdentity.cs
- TranslateTransform.cs
- NameTable.cs
- xmlfixedPageInfo.cs
- NativeMethods.cs
- WebPartTransformer.cs
- ItemsPanelTemplate.cs
- PhonemeEventArgs.cs
- HandlerBase.cs
- SelectionProviderWrapper.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- RankException.cs
- ArraySegment.cs
- LayoutTableCell.cs
- ValidationResult.cs
- SrgsGrammarCompiler.cs
- PathGeometry.cs
- NoResizeHandleGlyph.cs
- HtmlProps.cs
- DataServiceRequestException.cs
- InternalConfigEventArgs.cs
- graph.cs
- SiteOfOriginContainer.cs
- ExecutedRoutedEventArgs.cs
- ParserOptions.cs
- DataSourceCollectionBase.cs
- CallbackValidator.cs
- NumberAction.cs
- ButtonField.cs
- SqlSelectStatement.cs
- LOSFormatter.cs
- TypeBrowserDialog.cs
- DateTimeFormat.cs
- RadioButton.cs
- ReadOnlyPropertyMetadata.cs
- CompositeFontInfo.cs
- _AuthenticationState.cs
- XsdBuilder.cs
- MenuAdapter.cs
- DeadCharTextComposition.cs
- CompiledScopeCriteria.cs
- ToolStripStatusLabel.cs
- ValueChangedEventManager.cs
- WebPartEditVerb.cs
- ServerIdentity.cs
- HttpPostedFile.cs
- QueryAsyncResult.cs
- ReadOnlyHierarchicalDataSource.cs
- DefaultEvaluationContext.cs
- DrawingAttributeSerializer.cs
- DataControlField.cs
- ContextMenu.cs
- ValueTypeFixupInfo.cs
- Animatable.cs