mormot2封装tcp

摘要:
mormot2封装tcp这没什么好惊奇的,http是基于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)

免责声明:文章转载自《mormot2封装tcp》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇MacBookM1通过DockerDesk安装MySQL8容器new Date():时间的获取和转换下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

SQL Server中执行正则表达式

如果执行上述函数,将报告以下错误:SQL Server阻塞进程'syssp_可以为OACreate的访问执行以下SQL语句:USEmasterGOsp_configure'showadvancedoptions',1;戈尔配置;GOsp_配置'OleAutomationProcedures',1;戈尔配置;GOsp_配置'AdHocDistributedQu...

您的硬件设置已被更改,请重新启动计算机,使更改生效

在Win7旗舰系统上,出现“您的硬件设置已更改,请重新启动计算机以使更改生效”。开机后将弹出“您的硬件设置已更改,请重新启动计算机”窗口。不要关闭它。打开任务管理器,右键单击以转到进程,查看其中是否有正在运行的进程。进程名称为:atieclxx.exe右键单击进程打开文件的位置。将此程序移出原始文件夹(最好是另一个磁盘),然后重新启动计算机。...

influxdb简单使用

之前对influxdb有一个简单的了解和入门的使用,近期由于想使用influxdb做一点东西玩玩,又要捡起influxdb。而在influxdb下没有细分的表的概念,influxdb下的表在插入数据库的时候自动会创建。更多用户权限设置可以参看官方文档:https://docs.influxdata.com/influxdb/v1.0/query_langua...

说说接口封装

今天,我为同事封装了一个接口。当谈到接口封装时,有很多关于它的讨论。在很多情况下,说一个服务好,一个服务坏,实际上是在吐槽服务团队之外暴露的界面质量。无论哪种语言,抽象的封装接口都由一个函数名、几个参数和几个返回值组成。总之,参数不应该被封装……我们在内部尝试接口_Catch不会抛出异常,所有信息都将以错误代码的形式返回。就php而言,建议进行异常处理。...

ABB机器人功能程序(FUNC)

功能程序的应用范围非常广泛。熟练的人员可以根据不同的需求创建相应的功能程序。函数程序的固定格式是FUNC,返回结束。在ABB的学习中,许多学生对功能程序几乎一无所知,即使他们真的在使用它。在学习ABB的过程中,我遇到了几个用例,所以我总结了它们以加深我的理解。...

Uni-app v-on监听事件

使用标记上的v-on监视事件。缩写为@click common click events方法:方法:{Focus(){console.log;},blur(){console.log;},confirm(){console.log;},click(){console.log;},tap(){console.log;},longpress(){console....