ConnectSocket.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // ConnectSocket.h : header file
  2. #if !defined(AFX_CONNECTSOCKET_H__B7C54BD3_A555_11D0_8996_00AA00B92B2E__INCLUDED_)
  3. #define AFX_CONNECTSOCKET_H__B7C54BD3_A555_11D0_8996_00AA00B92B2E__INCLUDED_
  4. #if _MSC_VER >= 1000
  5. #pragma once
  6. #endif // _MSC_VER >= 1000
  7. class CDataSocket;
  8. class CConnectSocket : public CSocket
  9. {
  10. enum // Token ID's
  11. {
  12. TOK_ABOR, TOK_BYE, TOK_CDUP, TOK_CWD,
  13. TOK_DELE, TOK_DIR, TOK_HELP, TOK_LIST,
  14. TOK_MKD, TOK_NOOP, TOK_PASS, TOK_PASV,
  15. TOK_PORT, TOK_PWD, TOK_QUIT, TOK_REST,
  16. TOK_RETR, TOK_RMD, TOK_RNFR, TOK_RNTO,
  17. TOK_SIZE, TOK_STOR, TOK_SYST, TOK_TYPE,
  18. TOK_USER, TOK_ERROR,
  19. };
  20. public:
  21. int m_bPassiveMode;
  22. int m_nRemotePort;
  23. CString m_strRemoteHost;
  24. CDataSocket *m_pDataSocket;
  25. struct CFTPCommand
  26. {
  27. int m_nTokenID;
  28. char *m_pszName;
  29. BOOL m_bHasArguments;
  30. char *m_pszDescription;
  31. };
  32. // Attributes
  33. public:
  34. BOOL HasConnectionDropped(void);
  35. BOOL SendResponse(LPCTSTR pstrFormat, ...);
  36. void FireStatusMessage(LPCTSTR lpszStatus, int nType);
  37. BOOL GetRxCommand(CString &command, CString &args);
  38. BOOL CreateDataConnection(int nTransferType, LPCTSTR lpszData);
  39. void DestroyDataConnection();
  40. // Operations
  41. public:
  42. CConnectSocket();
  43. virtual ~CConnectSocket();
  44. void ParseCommand();
  45. // Overrides
  46. public:
  47. CWinThread* m_pThread;
  48. BOOL m_bLoggedon;
  49. CString m_strUserName;
  50. // ClassWizard generated virtual function overrides
  51. //{{AFX_VIRTUAL(CConnectSocket)
  52. public:
  53. virtual void OnClose(int nErrorCode);
  54. virtual void OnReceive(int nErrorCode);
  55. virtual void OnConnect(int nErrorCode);
  56. //}}AFX_VIRTUAL
  57. // Generated message map functions
  58. //{{AFX_MSG(CConnectSocket)
  59. // NOTE - the ClassWizard will add and remove member functions here.
  60. //}}AFX_MSG
  61. // Implementation
  62. protected:
  63. CStringList m_strCommands;
  64. void GetRxLine();
  65. BOOL m_bRenameFile;
  66. DWORD m_dwRestartOffset;
  67. CString m_strRenameFile;
  68. CString m_RxBuffer;
  69. CString m_strCurrentDir;
  70. };
  71. /////////////////////////////////////////////////////////////////////////////
  72. //{{AFX_INSERT_LOCATION}}
  73. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  74. #endif // !defined(AFX_CONNECTSOCKET_H__B7C54BD3_A555_11D0_8996_00AA00B92B2E__INCLUDED_)