The Labs \ Source Viewer \ SSCLI \ System.Net \ NestedSingleAsyncResult

  1. //------------------------------------------------------------------------------
  2. // <copyright file="_NestedSingleAsyncResult.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.Net
  16. {
  17.    
  18.     //
  19.     // The NestedAsyncResult - used to wrap async requests
  20.     // this is used to hold another async result made
  21.     // through a call to another Begin call within.
  22.     //
  23.     internal class NestedSingleAsyncResult : LazyAsyncResult
  24.     {
  25.         //
  26.         // this is usually for operations on streams/buffers,
  27.         // we save information passed in on the Begin call:
  28.         // since some calls might need several completions, we
  29.         // need to save state on the user's IO request
  30.         //
  31.         internal byte[] Buffer;
  32.         internal int Offset;
  33.         internal int Size;
  34.        
  35.         //
  36.         // Constructors
  37.         //
  38.        
  39.         // Completed in advance.
  40.         internal NestedSingleAsyncResult(object asyncObject, object asyncState, AsyncCallback asyncCallback, object result) : base(asyncObject, asyncState, asyncCallback, result)
  41.         {
  42.         }
  43.        
  44.         internal NestedSingleAsyncResult(object asyncObject, object asyncState, AsyncCallback asyncCallback, byte[] buffer, int offset, int size) : base(asyncObject, asyncState, asyncCallback)
  45.         {
  46.             Buffer = buffer;
  47.             Offset = offset;
  48.             Size = size;
  49.         }
  50.        
  51.     }
  52.     // class NestedAsyncResult
  53. }
  54. // namespace System.Net

Developer Fusion