-
一个线程池的一个类,基本使用如下:
一个线程驰的类, 下面的是基本的使用方法 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
-
自己写的一个 Base64 编码解码工具,fcl 里已经有了,写这个主要是为了让大家了解 Base64 编码原理...
自己写的一个 Base64 编码解码工具,fcl 里已经有了,写这个主要是为了让大家了解 Base64 编码原理-His writing a Base64 encoding and decoding tools, fcl were already there, writing this mainly to let everyone understand the principles of Base64 Encoding
- 2022-01-26 00:36:37下载
- 积分:1
-
ISDA信用违约互换(CDS)的模型(Excel)和(c)
ISDA Credit Default Swap (CDS) Model (Excel and C)
- 2022-01-31 00:55:30下载
- 积分:1
-
assembly language magazines in the game, the basic operation and online games, i...
用汇编语言实现的推箱子游戏,基本的操作和网上的游戏一样,只就做了一关,有兴趣的朋友可以帮着完成其他的-assembly language magazines in the game, the basic operation and online games, it was done only a clearance, interested friends can help to complete the other
- 2023-04-21 05:20:03下载
- 积分:1
-
Excel修复2003
excel修复工具。可以帮助大家修复excel。请大家多多支持!-excel repair 2003
- 2022-01-25 19:06:58下载
- 积分:1
-
WindowsXP的系统图标库,图标总数累计417个,可以丰富您的素材库,令您的用户界面更加赏心悦目。...
WindowsXP的系统图标库,图标总数累计417个,可以丰富您的素材库,令您的用户界面更加赏心悦目。-WindowsXP system icon library, icon cumulative total 417, you can enrich the material library, your user interface more pleasing to the eye.
- 2022-03-16 07:22:04下载
- 积分:1
-
程序在系统托盘中显示的托盘类
程序在系统托盘中显示的托盘类-procedures in the system tray shows the type tray
- 2023-02-24 20:15:03下载
- 积分:1
-
VC各种综合类的设计,包含有:菜单类、操作Excel类、ADO、打印等等。...
VC各种综合类的设计,包含有:菜单类、操作Excel类、ADO、打印等等。-VC range of integrated design, includes: menu category, operation Excel type, ADO, Print, etc..
- 2022-04-17 19:07:58下载
- 积分:1
-
嵌入式动画类拷贝屏幕程序,用EVC开发实现
嵌入式动画类拷贝屏幕程序,用EVC开发实现-Embedded animated screen-type copy of the procedures developed by EVC realize
- 2022-02-14 20:32:42下载
- 积分:1
-
这是一个求非线性方程一个实根的牛顿法,函数返回标志值。若返回的标志值大于等于0则表示正常返回...
这是一个求非线性方程一个实根的牛顿法,函数返回标志值。若返回的标志值大于等于0则表示正常返回-This is a nonlinear equation for a real root of the Newton method, function return value signs. If the sign of the return value greater than or equal to 0 that the normal return
- 2022-02-24 10:03:58下载
- 积分:1