controlsocket.h

来自「1)用户界面模块负责响应用户的键盘鼠标输入设置服务器的各个参数」· C头文件 代码 · 共 67 行

H
67
字号
#if !defined(AFX_CONTROLSOCKET_H__EBF9911B_5060_4F80_AD63_5DD763607BE4__INCLUDED_)
#define AFX_CONTROLSOCKET_H__EBF9911B_5060_4F80_AD63_5DD763607BE4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ControlSocket.h : header file
//
#include "FTPClientDlg.h"
#include "afxmt.h"	//CCriticalSection required.

class CFTPClientDlg;
/////////////////////////////////////////////////////////////////////////////
// CControlSocket command target

class CControlSocket : public CSocket
{
// Attributes
public:
	bool welcomed;
	CString receiveBuf;
	CFTPClientDlg* m_pClientDlg;
	CStringList m_userCommandList;
	CStringList m_serverCommandList;
	CCriticalSection m_criticalSection;
// Operations
public:
	CControlSocket();
	virtual ~CControlSocket();

// Overrides
public:
	void inline AddServerReply(LPCTSTR serverReply)
	{
		m_criticalSection.Lock();
		m_serverCommandList.AddTail(serverReply);	
		m_criticalSection.Unlock();
	}
	bool CreateDataSocket();
	bool GetListData(LPCTSTR remotePath);
	bool WaitFor(LPCTSTR commandCode);
	bool Login(LPCTSTR userName,LPCTSTR userPsw);
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CControlSocket)
	public:
	virtual void OnConnect(int nErrorCode);
	virtual void OnSend(int nErrorCode);
	virtual void OnClose(int nErrorCode);
	virtual void OnReceive(int nErrorCode);
	//}}AFX_VIRTUAL

	// Generated message map functions
	//{{AFX_MSG(CControlSocket)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

// Implementation
protected:
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CONTROLSOCKET_H__EBF9911B_5060_4F80_AD63_5DD763607BE4__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?