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)

  • 相关阅读:
    LeetCode | Contains Duplicate III
    LeetCode | Contains Duplicate II
    LeetCode | Contains Duplicate
    LeetCode | Find Minimum in Rotated Sorted Array II
    CentOS下使用yum快速安装memcached
    centos6.5安装Apache+MySQL+PHP
    centos 防火墙开放80端口
    jeecms搜索结果排序-二次开发
    JS常用的标准函数
    spring download
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/14040297.html
Copyright © 2011-2022 走看看