• 2024-05-27Day3_beast实现http server
    一、绑定和监听连接在1CServer.h中声明acceptor,以及用于事件循环的上下文iocontext,和构造函数classCServer:publicstd::enable_shared_from_this<CServer>{public:CServer(boost::asio::io_context&ioc,unsignedshort&port); //构造函数voidStart(); /
  • 2024-01-14boost框架 创建websocket非阻塞服务
    #include<iostream>#include<boost/asio.hpp>#include<boost/beast.hpp>#include<boost/beast/websocket.hpp>namespaceasio=boost::asio;namespacebeast=boost::beast;namespacewebsocket=beast::websocket;usingtcp=asio::
  • 2023-12-18boost beast http::read 一直阻塞不返回,问题解决, 使用parser对象的skip(true) 来解决
    用beast作为客户端发送http请求后读web服务端返回的数据,遇到了http::read或http::async_read一直阻塞着,不返回,直到连接过期后被强制网络断开后read函数才返回。看了官方文档,文档里这么描述的,read要一直等到end_of_stream时才回退出阻塞状态。也就是连接失效后才行。但我们的
  • 2023-08-14 beast网络库搭建http服务器
    参考:https://llfc.club/category?catid=225RaiVNI8pFDD5L4m807g7ZwmF#!aid/2RlhDCg4eedYme46C6ddo4cKcFN简介前面的几篇文章已经介绍了如何使用asio搭建高并发的tcp服务器,以及http服务器。但是纯手写http服务器太麻烦了,有网络库beast已经帮我们实现了。这一期讲讲如何使用beast
  • 2023-04-17虚基类应用
    一、编写动物类animal,受保护数据成员name(名称、,string),age(年龄,int),公有函数成员void show(),输出“Animal,名称,年龄";公有派生鱼类fish加兽类beast,鱼类增加受保护数据成员velocity(速度,int),公有函数成员void show(),输出“Fish,名称,年龄,速度";兽类增加受保护数据成员aPpetite(食
  • 2022-11-21PHP 之beast扩展加密源码
    一、安装1、windows安装教程下载地址:​​https://github.com/imaben/php-beast-binaries​​将下载的扩展放入对应php的ext目录修改php.ini添加配置:extension=php_beast_x
  • 2022-08-15gorm tips
    约定的列明typeUserstruct{IDuint//列名是`id`Namestring//列名是`name`Birthdaytime.Time//列名是`birthday`CreatedA