📄 clientsock.h
字号:
#if !defined(AFX_CLIENTSOCK_H__349A4EE8_1CFC_4353_843A_DD8D7FFCCA28__INCLUDED_)
#define AFX_CLIENTSOCK_H__349A4EE8_1CFC_4353_843A_DD8D7FFCCA28__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ClientSock.h : header file
//
#include "MyMessage.h"
#include "ServerMessage.h"
#include <afxtempl.h>
/////////////////////////////////////////////////////////////////////////////
// CClientSock command target
class CChineseChessDlg;
class CClientSock : public CSocket
{
// Attributes
public:
CArchive* m_aSessionIn;
CArchive* m_aSessionOut;
CSocketFile* m_sfSocketFile;
CChineseChessDlg * m_pDlg;
bool m_bInit;
bool m_bClose;
//CList<>
public:
void Init();
BOOL SendMessage(CMyMessage * msg);
void CloseSocket();
public:
static int GetLocalHostName(CString &sHostName); //获得本地计算机名称
static int GetIpAddress(const CString &sHostName, CString &sIpAddress);//获得本地IP
static int GetIpAddress(const CString &sHostName, BYTE &f0,BYTE &f1,BYTE &f2,BYTE &f3);//获得本地IP
static CString ErrorReason(int tag); //
// Operations
public:
CClientSock();
virtual ~CClientSock();
// Overrides
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CClientSock)
public:
virtual void OnReceive(int nErrorCode);
virtual void OnClose(int nErrorCode);
//}}AFX_VIRTUAL
// Generated message map functions
//{{AFX_MSG(CClientSock)
// 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_CLIENTSOCK_H__349A4EE8_1CFC_4353_843A_DD8D7FFCCA28__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -