public CommandThread( ThreadSupervisor InSupervisor, TelnetConnection InConn, TelnetCommandRoute InCommandRoute, RunLogListBox InRunLog) { mShutdownFlag = new ExtendedManualResetEvent(false); mConn = InConn; mCommandRoute = InCommandRoute; mRunLog = InRunLog; Supervisor = InSupervisor; }
public ReceiveThread( TelnetConnection InConn, AutoResetEvent InStartReceivingEvent, ThreadSupervisor InSupervisor, ExtendedManualResetEvent InShutdownFlag, RunLogListBox InRunLog) { mConn = InConn; mSupervisor = InSupervisor; mSupervisor.AssignRunningReceiveThread(this); mStartReceivingEvent = InStartReceivingEvent; mRunLog = new RunLogListBox(InRunLog, "ReceiveThread"); mShutdownFlag = InShutdownFlag; }
// ----------------------------- RunCommand ------------------------------------ public static void RunCommand( ThreadSupervisor InSupervisor, TelnetConnection InConn, TelnetCommandRoute InCommandRoute, RunLogListBox InRunLog, string InCmdText) { { RunLogListBox runLog = new RunLogListBox(InRunLog, "RunCommand"); CommandThread ct = new CommandThread( InSupervisor, InConn, InCommandRoute, InRunLog); ct.CommandText = InCmdText; // run the logout thread. CommandThread.ThreadStart(ct); } }
// ---------------------- StartReceiveFromTelnetServerThread ---------------------- public static void StartReceiveFromTelnetServerThread( // out DataQueue OutReceiveDataQueue, out AutoResetEvent OutStartReceivingEvent, TelnetConnection InConn, ThreadSupervisor InSupervisor, ExtendedManualResetEvent InShutdownFlag, RunLogListBox InRunLog) { // create the event that the receive thread listens to to be signaled that it // should wake up and receive from the telnet server. OutStartReceivingEvent = new AutoResetEvent(false); // setup the ReceiveThread object with all the object references it needs. ReceiveThread rt = new ReceiveThread( InConn, OutStartReceivingEvent, InSupervisor, InShutdownFlag, InRunLog); // start the ReceiveThread. ReceiveThread.ThreadStart(rt); }