www.pudn.com > pop3.rar > AcceptSocket.h


#if !defined(AFX_ACCEPTSOCKET_H__DAD3594E_6347_4292_9811_B8BAAF142954__INCLUDED_) 
#define AFX_ACCEPTSOCKET_H__DAD3594E_6347_4292_9811_B8BAAF142954__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
//功能: 处理客户端命令并返回消息 
//    2006/12/08 
 
#include "CMailAdapter.h" 
#include "FileConvert.h" 
#include "Afxmt.h" 
///////////////////////////////////////////////////////////////////////////// 
// CAcceptSocket command target 
 
class CAcceptSocket : public CSocket 
{ 
// Attributes 
public: 
	int m_nPort;          //socket port 
    int m_imailCount;     //mail count 
    int m_iState;         //mailbox state 
	int m_iChkTimes; 
	int time_consuming;//时间间隔 
//	CCriticalSection m_commstr_critical; 
	CString m_strUser, m_strtempUser;   // 
	CString m_sSocket;    //ip address 
    CString m_Key;        //公钥 
    CString m_strComm;    //接收的用户字符串 
	DWORD m_dwThreadId; 
	CPtrList m_pMailList; 
	CStringList strDeleteMailList,strReadMailList; 
    CStringArray m_strCommArr; 
	BOOL m_bIsError;//判断返回是否出错 
	BOOL m_bIsRetr;//判断是否发送邮件	 
 
 
	tagMAIL_TRANS_LOG maillog;//log struct 
 
//	CMailAdapter m_mailadapter; 
// Operations 
public: 
	CAcceptSocket(); 
	virtual ~CAcceptSocket(); 
 
	void DeleteMailList(CPtrList &plMails); 
    BOOL NewMailList(CPtrList &plMails, int imailCount, CString &strErr); 
	// Overrides 
public: 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CAcceptSocket) 
	public: 
	virtual void OnReceive(int nErrorCode); 
	virtual void OnClose(int nErrorCode); 
 
  //}}AFX_VIRTUAL 
 
	// Generated message map functions 
	//{{AFX_MSG(CAcceptSocket) 
		// NOTE - the ClassWizard will add and remove member functions here. 
	//}}AFX_MSG 
 
// Implementation 
private: 
    int ParseCommand(CString strCmd); 
    void AnalyseReceiveStr(CString strReceive); 
	void DisposeComm(); 
	BOOL IsTrueComm(CString strClientCommand, CString &strCommand, CString &strPara); 
	CString AnalyseComm(CString strClientCommand); 
    BOOL GetMimeStr(LPVOID pMail, CString &mimeMailStr, CString &strError); 
    BOOL GetMail(CString strComm, CString strUser, CString strPass, CString &strErr); 
    CString DisposeUSER(CString strPara); 
    CString DisposePASS(CString strPara); 
    CString DisposeNOOP(CString strPara); 
    CString DisposeQUIT(CString strPara); 
    CString OnUnknown(CString strPara); 
    CString DisposeAPOP(CString strPara); 
	CString DisposeSTAT(CString strPara); 
	CString DisposeLIST(CString strPara); 
	CString DisposeRETR(CString strPara); 
	CString DisposeDELE(CString strPara); 
	CString DisposeRSET(CString strPara); 
	CString DisposeTOP(CString strPara); 
	CString DisposeUIDL(CString strPara); 
 
protected: 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_ACCEPTSOCKET_H__DAD3594E_6347_4292_9811_B8BAAF142954__INCLUDED_)