📄 clistensocket.h
字号:
//
// CListenSocket.h
// Created by Qiming Lu, 2002-02-25
//
#if !defined(__CListenSocket_h__)
#define __CListenSocket_h__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxtempl.h>
//////////////////////////////////////////////////////////////////////////////
class CListenSocket
{
public:
CListenSocket();
virtual ~CListenSocket();
// Attributes
protected:
SOCKET m_hSocket; // Socket handle
bool m_bListening; // Listening thread active flag
HANDLE m_hThrdFinish; // Listening thread terminate event
int m_nLimitCount; // Max connection
public:
CList <SOCKET, SOCKET> m_ClientList;
public:
bool Create(int inPort);
bool StartListen(void);
void StopListen(void);
bool Accept(void);
// Limit connection feature
void SetLimitConnection(int inMax);
int GetLimitConnection(void);
static UINT ListeningThrd(void *pParam);
};
#endif // !defined(__CListenSocket_h__)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -