-
一个线程池的一个类,基本使用如下:
一个线程驰的类, 下面的是基本的使用方法 struct TSession { SOCKET socket int id } class myIocp:public CIOCP { public: void OnRead(void * p, char * buf, int len) void OnAccept(SOCKET socket) void OnClose(void * p) } void myIocp::OnAccept(SOCKET socket) { TSession *s = new TSession s->socket = socket //这里可以对连接的session进行自己的操作,例如给id找一个唯一的值 SetIoCompletionPort(socket, s) // 使连接socket与一个自定义结构体关联 } void myIocp::OnRead(void * p, char * buf, int len) { TSession *s = (TSession *)p send(s->socket, buf, len, 0) // 这里只是简单的把收到的消息返回给客户端 ... } void myIocp::OnClose(void * p) { delete p } myIoncp iocp main() { ... iocp.listen(4311) // 开始监听网络端口,等待客户端连接 ... }-A class for thread pool,basic usage below:
struct TSession { SOCKET socket int id } class myIocp:public CIOCP
{ public:
void OnRead(void* p, char* buf, int len)
void OnAccept(SOCKET socket)
void OnClose(void* p) }
void myIocp::OnAccept(SOCKET socket)
{ TSession*s = new TSession s->socket = socket
//here you can do something about connecti
- 2022-07-17 05:14:52下载
- 积分:1
-
vc6.0相关安装配置,void CJisuanqiDlg::OnBUTTONdecimal()
{
// TODO: Add your contro...
vc6.0相关安装配置,void CJisuanqiDlg::OnBUTTONdecimal()
{
// TODO: Add your control notification handler code heredecimal=true
}
void CJisuanqiDlg::OnBUTTONclear()
{
// TODO: Add your control notification handler code here
UpdateData(true)
value=0
input1=0
input2=0
_gcvt(value,10,buffer) -vc6.0 related installation configuration, void CJisuanqiDlg:: OnBUTTONdecimal () (//TODO: Add your control notification handler code heredecimal = true ) void CJisuanqiDlg:: OnBUTTONclear () (//TODO: Add your control notification handler code here UpdateData (true) value = 0 input1 = 0 input2 = 0 _gcvt (value, 10, buffer)
- 2022-08-05 23:29:21下载
- 积分:1
-
猫吃老鼠问题的算法程序的VC完整应用程序代码.
猫吃老鼠问题的算法程序的VC完整应用程序代码.-cats eat rats of the VC algorithm complete application code.
- 2022-02-04 06:16:25下载
- 积分:1
-
windows mobile上与http服务器通信,可下载网页、文件
windows mobile上与http服务器通信,可下载网页、文件-windows mobile with http server communications, download website, documents
- 2023-09-05 02:30:03下载
- 积分:1
-
Any cs. student a ny average university will at some point be faced with design...
Any cs. student a ny average university will at some point be faced with design patterns (dp for the rest of the article). Dp s are generic principles or best practices from software development. This article is not an introduction to dp s, since others have already covered that in longer and better written articles. Instead, this article deals with implementing and re-using C++ templates when thinking dp s. -Any cs. Student a ny average university will at some point be faced with design patterns (dp for the rest of the article). Dp s are generic principles or best practices from software development. This article is not an introduction to dp s, since others have already covered that in longer and better written articles. Instead, this article deals with implementing and re-using C++ templates when thinking dp s.
- 2022-06-16 19:07:14下载
- 积分:1
-
opencascade+color scale
是用opencascade为三维图形做颜色渲染,需先从文件当中读取点云文件,然后画成三角网格,最后再着色。着色的时候根据三角所受到的压力不同来显示颜色。
- 2022-05-19 06:17:58下载
- 积分:1
-
一组开放源音频信号处理和算法综合类。
a set of open source audio signal processing and algorithmic synthesis classes writtern in C
- 2023-06-06 16:05:04下载
- 积分:1
-
C++通用算法之非修正算法,其中包括查找容器中相同的元素,容器中相同的元素统计等等,这些算法都比较高效,直接就可以复制使用,特别方便。...
C++通用算法之非修正算法,其中包括查找容器中相同的元素,容器中相同的元素统计等等,这些算法都比较高效,直接就可以复制使用,特别方便。-generic algorithm C non-correction algorithms, including the search for packaging the same elements, Vessel Statistics same elements, and so on, these algorithms are more efficient and can directly copy, in particular convenience.
- 2023-03-30 05:10:03下载
- 积分:1
-
AES 加密算法 和相关 代码实现
资源描述高级加密标准(英语:Advanced Encryption Standard,缩写:AES),在密码学 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
- 2022-07-02 12:59:55下载
- 积分:1
-
这是一个帮助文件的Visual Basic程序开发。
this a help file about develop visual basic programe.
- 2022-01-22 16:11:45下载
- 积分:1