tnclass.h
上传用户:tigerk9
上传日期:2020-03-10
资源大小:237k
文件大小:2k
源码类别:

Telnet客户端

开发平台:

Visual C++

  1. #ifndef __TNCLASS_H_
  2. #define __TNCLASS_H_
  3. #include <windows.h>
  4. #include "tnconfig.h"
  5. #include "ttelhndl.h"
  6. #include "tncon.h"
  7. #include "tnerror.h"
  8. #include "tparams.h"
  9. #include "keytrans.h"
  10. #include "ansiprsr.h"
  11. #include "tcharmap.h"
  12. #include "tnclip.h"
  13. #include "tmouse.h"
  14. #include "tmapldr.h"
  15. class Telnet {
  16. public:
  17. // create a telnet instance
  18. Telnet();
  19. // open a connection return on break/quit
  20. Telnet(const char * szHost1, const char *strPort1);
  21. ~Telnet();
  22. // open a connection return on break/quit
  23. int Open(const char *szHost, const char *strPort = "23");
  24. int Close(); // close current connection
  25. int Resume(); // resume current session
  26. // changes to the keymap profile in the file
  27. int LoadKeyMap( const char * file, const char * name);
  28. void DisplayKeyMap(); // display available keymaps
  29. int  SwitchKeyMap(int); // switch to selected keymap
  30. private:
  31. SOCKET Connect();
  32. void telSetConsoleTitle(const char * szHost);
  33. void DoInit();
  34. SOCKET Socket;
  35. char strPort[32]; // int iPort;
  36. char szHost[127];
  37. volatile int bConnected;
  38. volatile int bWinsockUp;
  39. volatile int bNetPaused;
  40. volatile int bNetFinished;
  41. volatile int bNetFinish;
  42. // The order of member classes in the class definition MUST come in
  43. // this order! (Paul Brannan 12/4/98)
  44. TNetwork Network;
  45. TCharmap Charmap;
  46. KeyTranslator KeyTrans;
  47. TMapLoader MapLoader;
  48. TConsole Console;
  49. TTelnetHandler TelHandler;
  50. TelThreadParams ThreadParams;
  51. Tnclip Clipboard;
  52. TMouse Mouse;
  53. TScroller Scroller;
  54. TANSIParser Parser;
  55. HWND hConsoleWindow; // Paul Brannan 8/10/98
  56. LPARAM oldBIcon, oldSIcon; // Paul Brannan 8/10/98
  57. bool iconChange;
  58. HANDLE hThread; // Paul Brannan 8/11/98
  59. HANDLE hProcess; // Paul Brannan 7/15/99
  60. void NewProcess(); // Paul Brannan 9/13/98
  61. void SetLocalAddress(SOCKET s);
  62. };
  63. #endif