Coder Social home page Coder Social logo

yangyxd / yxdiocp Goto Github PK

View Code? Open in Web Editor NEW
89.0 11.0 38.0 20.74 MB

Delphi Windows IOCP 通讯模型封装,基于DIOCP。YxdIocp包含有支持大并发的TCP服务组件、HTTP服务组件、UDP服务组件、WebSocket服务组件,和TCP、UDP等基础客户端组件。

Pascal 77.95% C 21.56% HTML 0.49%

yxdiocp's Issues

MVC解析路由参数残缺问题

经调试跟踪,发现函数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;

WebSocket服务端并未实现半包和粘包处理

iocp.Http.WebSocket.pas中WebSocket本身的数据帧也可能存在半包问题。该单元并未处理此情况,目前只能处理收到的单个完整的的Frame,或者多个粘在一起的完整的Frame。这应属于一个较为严重的实现问题。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.