home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-19 | 1.6 KB | 72 lines | [TEXT/MMCC] |
- //
- // CTCPApplicationPP.cp
- //
- // TurboTCP library
- // Application mix-in class
- // PowerPlant-specific class
- //
- // Copyright © 1993-95, FrostByte Design / Eric Scouten
- //
-
- #include "CTCPApplicationPP.h"
-
- #include "UTurboTCP.h"
- #include "LApplication.h"
-
- #if !TurboTCP_PP
- #error: This file should be used with PowerPlant projects only!
- #endif
-
-
- //***********************************************************
-
- CTCPApplicationPP::CTCPApplicationPP(LApplication* inApplication)
-
- : LAttachment(msg_Event), mApplication(inApplication)
- {
-
- // set some default values
-
- mApplication->SetSleepTime(90); // don’t want to sleep for very long
- // ALSO, must set the “Background Null Events”
- // checkbox under Set Project Type…
- // (SIZE flags)
-
- mMaxTCPEvents = 0; // use TurboTCP’s default event count/tick count
- mMaxTCPTicks = 0; // as defined in UTurboTCP::ProcessNetEvents()
-
- // initialize TCP driver
-
- UTurboTCP::InitTCP();
-
- // arrange attachment
-
- mApplication->AddAttachment(this);
- SetOwnerHost(mApplication);
-
- }
-
-
- //***********************************************************
-
- CTCPApplicationPP::~CTCPApplicationPP()
-
- {
- UTurboTCP::CloseTCP();
- }
-
-
- // -- event-loop tap --
-
- //***********************************************************
-
- void CTCPApplicationPP::ExecuteSelf(MessageT inMessage, void* ioParam)
-
- // Here we tap into the event loop to process TCP completions and notifications, now freed
- // from interrupt-level constraints on memory management.
-
- {
- UTurboTCP::ProcessNetEvents(mMaxTCPEvents, mMaxTCPTicks, !mApplication->IsOnDuty());
- }
-
-