-
一个线程池的一个类,基本使用如下:
一个线程驰的类, 下面的是基本的使用方法 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
-
code-generator用visual c++做的一款一维条码生成器
用visual c++做的一款一维条码生成器-Using visual c++ to make a code generator
- 2023-01-18 07:55:04下载
- 积分:1
-
画矩阵盒子程序
矩阵盒子由X组成,输入两个数,第一个数代表矩阵盒子的数量,第二个数代表每个盒子中包含的矩阵列数,具体例子见程序说明
程序通过编译运行...
画矩阵盒子程序
矩阵盒子由X组成,输入两个数,第一个数代表矩阵盒子的数量,第二个数代表每个盒子中包含的矩阵列数,具体例子见程序说明
程序通过编译运行-Program matrix matrix box painting box components from X, enter the number two, the first number of the number of representatives of the matrix box, the second number representing each box contains the number of rows of the matrix, specific examples, see description of the procedures for the procedure to run through the compiler
- 2022-06-16 02:52:12下载
- 积分:1
-
与在 WindowsForms 编写的程序中创建的图形
VC + + 在 OpenGL 中绘制机器人机械手 (OpenGL-c + +) — — 使用基于 OpenGL 对话框编制本程序......开发使用 OPEN GL 基于仿真的 VC + + 6.0 的机械臂运动程序 (OpenGL-Visual c + +)-原始的发展建立了在 VC + + 环境 v......OpenGL (OpenGL-c + +)-一个 OpenGL 实现地图地图可以显示纹理的纹理......
- 2022-05-20 14:36:52下载
- 积分:1
-
在线制作图片/贺卡
在线制作图片/贺卡-online production Photo/cards
- 2022-04-10 21:46:20下载
- 积分:1
-
扩展的编程实例,比较多的程序
vc++ 的扩展编程的一些实例,比较多的程序-vc expansion of the programming examples, more procedures
- 2022-01-31 12:40:27下载
- 积分:1
-
xp界面的记事本源代码
xp界面的记事本源代码-xp interface code origin Chronicle
- 2022-07-03 06:50:56下载
- 积分:1
-
Information on the download page to download data from multiple sites of informa...
下载网页资料,下载多个网站的数据信息,实现数据共享-Information on the download page to download data from multiple sites of information, data sharing
- 2022-03-24 04:44:17下载
- 积分:1
-
该代码为在窗口的标题栏中显示按钮的演示代码。
该代码为在窗口的标题栏中显示按钮的演示代码。-display buttons on title bar.
- 2022-02-02 17:49:40下载
- 积分:1
-
A simple example for beginners in MATLAB to solve the differential eq using buil...
A simple example for beginners in MATLAB to solve the differential eq using built in functions of differential equation solvers.
- 2023-06-22 16:45:02下载
- 积分:1