home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / Internet / TurboTCP 2.1 ƒ / TurboTCP core / CTCPAsyncCall.h < prev    next >
Encoding:
Text File  |  1995-01-04  |  2.0 KB  |  90 lines  |  [TEXT/MMCC]

  1. //
  2. // CTCPAsyncCall.h
  3. //
  4. //    TurboTCP library
  5. //    TCP asynchronous call class
  6. //
  7. //    Copyright © 1993-95, FrostByte Design / Eric Scouten
  8. //
  9.  
  10. #pragma once
  11.  
  12. #include "TurboTCP.buildflags.h"
  13. #include "TurboTCP.types.h"
  14. #include "CTCPDriver.h"
  15.  
  16. #if TurboTCP_UH2
  17.     #include <MacTCP.h>
  18. #else
  19.     #include <TCPPB.h>
  20. #endif
  21.  
  22. #if TurboTCP_PPC
  23.     #pragma options align=mac68k
  24. #endif
  25.  
  26. class CTCPStream;
  27.  
  28.  
  29. //***********************************************************
  30.  
  31. class CTCPAsyncCall {
  32.  
  33. // This object encapsulates each asynchronous call to MacTCP. This method is used so that
  34. // the call’s I/O block may persist beyond the scope of the method call which originates the
  35. // call (these methods are located in CTCPStream).
  36. //
  37. // NOTE: All interaction with CTCPAsyncCalls should be through CTCPStream. No other class
  38. // should have a reason to use this object, nor should this object be subclassed. Accordingly,
  39. // all members of this class are declared private.
  40.  
  41.  
  42.     friend class CTCPStream;
  43.     friend class CTCPDriver;
  44.  
  45.  
  46. private:
  47.     CTCPAsyncCall(CTCPStream& theStream)
  48.     : itsStream(theStream), itsStreamEntry(this)
  49.     {
  50.         itsiopb.itsQElem.qType = asyncCall;
  51.         itsiopb.itsQElem.qSelfLink = this;
  52.     }
  53.  
  54.     // initiate, process TCP call
  55.  
  56.     OSErr                DoAsyncCall(short theCsCode, TCPiopb* theParamBlockPtr);
  57.     OSErr                DoAsyncCall(short theCsCode);
  58.     
  59.     void                    ProcessCompletion();
  60.     Boolean                Dispatch();
  61.     Boolean                DispatchNoCopyRcv();
  62.  
  63.     // completion procedure
  64.         
  65.     static void            GetCompletionProc();
  66.  
  67.     #if TurboTCP_68K
  68.         static pascal void  CompletionProc();
  69.     #else
  70.         static pascal void  CompletionProc(struct TurboTCPiopb* iopb);
  71.     #endif
  72.  
  73.  
  74.     // data members
  75.  
  76.     CTCPStream&            itsStream;            // the stream that requested this call
  77.     TurboTCPiopb            itsiopb;                // the TCP parm block, plus a few things (see “TCPCompletionProc.h”)
  78.     TurboTCPQElem            itsStreamEntry;        // entry in stream object’s call list
  79.  
  80.     #if TurboTCP_CFM
  81.         static UniversalProcPtr completionProcUPP;    // UPP for asynchronous completion proc
  82.     #endif
  83.  
  84. };
  85.  
  86.  
  87. #if TurboTCP_PPC
  88.     #pragma options align=reset
  89. #endif
  90.