yangyxd / yxdiocp Goto Github PK
View Code? Open in Web Editor NEWDelphi Windows IOCP 通讯模型封装,基于DIOCP。YxdIocp包含有支持大并发的TCP服务组件、HTTP服务组件、UDP服务组件、WebSocket服务组件,和TCP、UDP等基础客户端组件。
Delphi Windows IOCP 通讯模型封装,基于DIOCP。YxdIocp包含有支持大并发的TCP服务组件、HTTP服务组件、UDP服务组件、WebSocket服务组件,和TCP、UDP等基础客户端组件。
IDE:delphi xe(Embarcadero® Delphi® XE Version 15.0.3953.35171 )
DEBUG模式下可以编译通过,Releasse模式下报错:[DCC Error] ZLibExGZ.pas(508): E2003 Undeclared identifier: 'ZCompressString2'
经调试跟踪,发现函数InitPathVariable有BUG
修改后,解析正常,修改代码如下:
procedure InitPathVariable(const URI: string; const Item: TUriMapData;
APathVariable: TDictionary<string, string>);
var
P1, P2, P3, P4, P5: PChar;
Key,Value: string;
begin
P1 := PChar(URI);
P3 := PChar(Item.Uri);
P4 := P3 + Length(Item.URI);
P2 := P1 + Length(URI);
while P3 < P4 do begin
if P3^ = '{' then begin
Inc(P3);
P5 := P3;
while (P3 < P4) and (P3^ <> '}') do
Inc(P3);
Key := PCharToString(P5, P3 - P5);
Inc(P3); // P3的位置}得在移动一下才到/
P5 := P1;
while (P1 < P2) and (P1^ <> '/') do
Inc(P1);
Value := PCharToString(P5, P1 - P5);
APathVariable.Add(Key, Value);
end;
Inc(P1);
Inc(P3);
end;
end;
iocp.Http.WebSocket.pas中WebSocket本身的数据帧也可能存在半包问题。该单元并未处理此情况,目前只能处理收到的单个完整的的Frame,或者多个粘在一起的完整的Frame。这应属于一个较为严重的实现问题。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.