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)

  • 相关阅读:
    objc之method&class attributes
    iOS之Export UIAutomation script
    js's forin vs oc's forin
    iOS新加速计事件
    Mac之Font管理
    iOS之VoiceOver
    OC之initialize
    C++常见问题
    objc新老runtime接口类型对比
    dlopen之mode参数详解
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/14040297.html
Copyright © 2011-2022 走看看