TDiocpCoderTcpServer 使用
uses diocp_coder_tcpServer,utils_zipTools,diocp_tcp_server,diocp_task
// 创建TCP SERVER
FTcpServer := TDiocpCoderTcpServer.Create(Self); // 心跳 FTcpServer.KeepAlive := true; // 工作线程数量// GetSystemInfo(si);// FTcpServer.WorkerCount := si.dwNumberOfProcessors * 2 + 1; // 创建监视 FTcpServer.createDataMonitor; // 注册编码、解码类 FTcpServer.registerCoderClass(TIOCPStreamDecoder, TIOCPStreamEncoder); // 注册客户端上下文 FTcpServer.registerContextClass(TMyClientContext); TFMMonitor.createAsChild(pnlMonitor, FTcpServer); FTcpServer.LogicWorkerNeedCoInitialize := true; FTcpServer.UseObjectPool := True;