home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / BlueBox Spy / Blue Box Daemon / source / CTCPServerThread.h < prev    next >
Encoding:
Text File  |  1998-08-06  |  1.6 KB  |  54 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    CTCPServerThread.h            ©1995-1998 Metrowerks Inc. All rights reserved.
  3. // ===========================================================================
  4.  
  5. #pragma once
  6.  
  7. #include <LTCPEndpoint.h>
  8. #include <LThread.h>
  9. #include <LSemaphore.h>
  10.  
  11. #include "CSimpleTCPServer.h"
  12. #include "CTerminalPane.h"
  13.  
  14. class CSimpleTCPServer;
  15.  
  16. // ===========================================================================
  17. //        • CTCPServerThread
  18. // ===========================================================================
  19. //    The thread that actually does the work of the server responder.
  20. //    Note that typed characters (i.e. data sent to the remote host
  21. //    are NOT handled by this object.) Only incoming data are processed
  22. //    here.
  23.  
  24. class CTCPServerThread :    public PP_PowerPlant::LThread {
  25.  
  26. public:
  27.                         CTCPServerThread(
  28.                                 UInt16                inMaxConnections,
  29.                                 UInt16                inLocalPort,
  30.                                 PP_PowerPlant::LTCPEndpoint*        inNetworkEndpoint,
  31.                                 CSimpleTCPServer*    inServerMaster);
  32.     virtual                ~CTCPServerThread();
  33.  
  34.     void                StartDisconnect();
  35.     
  36. protected:
  37.     virtual void*        Run();
  38.     virtual void        SuspendServerThread();
  39.     virtual void        ResumeServerThread();
  40.  
  41.     PP_PowerPlant::LTCPEndpoint*        mEndpoint;
  42.     CSimpleTCPServer*                    mServerMaster;
  43.     UInt16                                mMaxConnections;
  44.     UInt16                                mPort;
  45.     
  46.     bool                                mDisconnectReceived;    // true if a T_DISCONNECT or T_ORDREL
  47.                                                                 //   event has occurred
  48.     bool                                mStartDisconnect;        // true if StartDisconnect() was called
  49.     
  50.     PP_PowerPlant::LSemaphore             mConnectionSignal;
  51.     
  52.     friend class CSimpleTCPServer;
  53. };
  54.