VTTelnetDaemon.h
上传用户:wsk323
上传日期:2007-01-05
资源大小:403k
文件大小:3k
- /*---------------------------------------------------------------------------
- Copyright: E. Brady Trexler
- Creation: March 13, 1998 (based on F. Piette's telnet server demo).
- A lot of code was lifted from his sources.
- Description: VTTelnetDaemon -- a class that owns a TWSocket component.
- The TWSocket listens to the telnet port and creates an
- instance of a VTTelnetSession to start the session.
- Legal issues: Copyright (C) 1998 by E. Brady Trexler and Fran鏾is Piette
- This software is provided 'as-is', without any express or
- implied warranty. In no event will the author be held liable
- for any damages arising from the use of this software.
- Permission is granted to anyone to use this software for any
- purpose, excluding commercial applications, and to alter it
- and redistribute it freely, subject to the following
- restrictions:
- 1. The origin of this software must not be misrepresented,
- you must not claim that you wrote the original software.
- If you use this software in a product, an acknowledgment
- in the product documentation would be appreciated but is
- not required.
- 2. Altered source versions must be plainly marked as such, and
- must not be misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source
- distribution.
- Updates:
- ---------------------------------------------------------------------------*/
- //---------------------------------------------------------------------------
- #ifndef VTTelnetDaemonH
- #define VTTelnetDaemonH
- //---------------------------------------------------------------------------
- #include <vclClasses.hpp>
- #include <vclControls.hpp>
- #include <vclStdCtrls.hpp>
- #include <vclForms.hpp>
- #include "WSocket.hpp"
- #define WM_DISCONNECT (WM_USER + 2)
- #define MAXSESSIONS 5
- //---------------------------------------------------------------------------
- class TVTDaemon : public TForm
- {
- __published: // IDE-managed Components
- TWSocket *SrvSocket;
- void __fastcall SrvSocketSessionAvailable(TObject *Sender, WORD Error);
- void __fastcall SrvSocketSessionClosed(TObject *Sender, WORD Error);
-
- private: // User declarations
- public: // User declarations
- char WelcomeMessage[256], ExitMessage[256];
- TList *TheSessions;
- int __fastcall GetNumSessions();
- __fastcall TVTDaemon(TComponent* Owner);
- protected:
- void __fastcall WMDisconnect(TMessage Message);
- BEGIN_MESSAGE_MAP
- MESSAGE_HANDLER(WM_DISCONNECT, TMessage, WMDisconnect)
- END_MESSAGE_MAP(TForm)
- };
- //---------------------------------------------------------------------------
- extern TVTDaemon *VTDaemon;
- //---------------------------------------------------------------------------
- #endif
-