zoukankan      html  css  js  c++  java
  • mormot2封装tcp

    mormot2封装tcp

    这没什么好惊奇的,http是基于tcp的应用层协议。

    mormot.net.sock.pas

    /// Fast low-level Socket implementation
    // - direct access to the OS (Windows, Linux) network layer API
    // - use Open constructor to create a client to be connected to a server
    // - use Bind constructor to initialize a server
    // - use SockIn and SockOut (after CreateSock*) to read/readln or write/writeln
    // as with standard Delphi text files (see SendEmail implementation)
    // - even if you do not use read(SockIn^), you may call CreateSockIn then
    // read the (binary) content via SockInRead/SockInPending methods, which would
    // benefit of the SockIn^ input buffer to maximize reading speed
    // - to write data, CreateSockOut and write(SockOut^) is not mandatory: you
    // rather may use SockSend() overloaded methods, followed by a SockFlush call
    // - in fact, you can decide whatever to use none, one or both SockIn/SockOut
    // - since this class rely on its internal optimized buffering system,
    // TCP_NODELAY is set to disable the Nagle algorithm
    // - our classes are (much) faster than the Indy or Synapse implementation
    TCrtSocket = class

    mormot.net.asynch.pas

    /// implements a thread-pooled high-performance TCP server
    // - will use a TAsynchConnection inherited class to maintain connection state
    // for server process
    TAsynchServer = class(TAsynchConnections)

    /// implements thread-pooled high-performance TCP multiple clients
    // - e.g. to run some load stress tests with optimized resource use
    // - will use a TAsynchConnection inherited class to maintain connection state
    // of each connected client
    TAsynchClient = class(TAsynchConnections)

  • 相关阅读:
    SSM之Mybatis整合及使用
    软件设计师08-法律法规与标准化知识
    Spring MVC体系结构
    Spring MVC异常友好展示
    Spring MVC Web.xml配置
    编译型语言解释型语言
    软件设计师07-程序设计语言与语言处理程序基础
    flex布局注意点:
    常见的PC端和移动端表单组件
    js文件的装载和执行
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/14040297.html
Copyright © 2011-2022 走看看