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
- Int64.cs
- ReflectEventDescriptor.cs
- BrowsableAttribute.cs
- Odbc32.cs
- BindingWorker.cs
- DuplexChannelFactory.cs
- TraceHwndHost.cs
- PrinterSettings.cs
- EncoderBestFitFallback.cs
- CaseExpr.cs
- ResourceDisplayNameAttribute.cs
- SchemaSetCompiler.cs
- EntityDesignerDataSourceView.cs
- HttpProfileBase.cs
- ReachPrintTicketSerializer.cs
- ProtectedProviderSettings.cs
- StoragePropertyMapping.cs
- ExpressionEditorAttribute.cs
- ExpandableObjectConverter.cs
- webclient.cs
- SortableBindingList.cs
- AnyReturnReader.cs
- SqlCommand.cs
- SingleQueryOperator.cs
- RectangleHotSpot.cs
- XmlQueryTypeFactory.cs
- PolyQuadraticBezierSegment.cs
- StyleReferenceConverter.cs
- TextPenaltyModule.cs
- ProcessModule.cs
- AppDomain.cs
- Exceptions.cs
- CssStyleCollection.cs
- SimpleWorkerRequest.cs
- HttpProcessUtility.cs
- TimeEnumHelper.cs
- Pair.cs
- SystemSounds.cs
- MailAddress.cs
- AdornerLayer.cs
- XmlSchemaElement.cs
- XmlILStorageConverter.cs
- TypeDelegator.cs
- HttpListenerPrefixCollection.cs
- MenuAdapter.cs
- DataGridRowEventArgs.cs
- DispatcherSynchronizationContext.cs
- Pointer.cs
- WebPartMenuStyle.cs
- ServiceModelReg.cs
- FlowDocumentReaderAutomationPeer.cs
- _UncName.cs
- RegexFCD.cs
- ParserExtension.cs
- Win32Native.cs
- UTF32Encoding.cs
- StateBag.cs
- DataListCommandEventArgs.cs
- UnsafeNativeMethods.cs
- ComplusEndpointConfigContainer.cs
- ColumnResizeAdorner.cs
- WindowsFormsSynchronizationContext.cs
- UrlParameterReader.cs
- MarkupObject.cs
- ReflectPropertyDescriptor.cs
- RadioButtonList.cs
- IMembershipProvider.cs
- BindingExpressionBase.cs
- SoapAttributeAttribute.cs
- FileSystemWatcher.cs
- IISUnsafeMethods.cs
- PrintDialog.cs
- FormsAuthenticationModule.cs
- StylusDevice.cs
- DataGridViewIntLinkedList.cs
- ImageDrawing.cs
- ReadOnlyPropertyMetadata.cs
- _SSPISessionCache.cs
- FormParameter.cs
- Buffer.cs
- PrintPreviewControl.cs
- DataTableCollection.cs
- DataServiceHost.cs
- ToolStripGrip.cs
- MdiWindowListItemConverter.cs
- BindingNavigator.cs
- ScrollBar.cs
- AutoResizedEvent.cs
- FrugalMap.cs
- KnownColorTable.cs
- CompModSwitches.cs
- PropertyManager.cs
- ProcessManager.cs
- HttpSocketManager.cs
- FileDialog.cs
- DynamicUpdateCommand.cs
- HotCommands.cs
- RegexMatchCollection.cs
- Comparer.cs
- AlternateViewCollection.cs