Creating a Sender/Receiver HTTP Server
TechAtBloomberg.com © 2024 Bloomberg Finance L.P. All rights reserved. • Create a basic HTTP server. • Allow a single-threaded server handling multiple clients. • Use the sender/receiver asynchronous std::execution (sender/receiver): http://wg21.link/p2300 • https://github.com/NVIDIA/stdexec.git • https://github.com/beman-project/execution26 • Sender/receiver networking: http://wg21.link/p2762 • Implementation: Implementation: https://github.com/beman-project/net29 • Async scope: http://wg21.link/p3149 Resources0 码力 | 8 页 | 2.19 MB | 5 月前3现代C++ 教程:高速上手C++11/14/17/20
习题 1. 在 Web 服务器开发中,我们通常希望服务某些满足某个条件的路由。正则表达式便是完成这一目 标的工具之一。 给定如下请求结构: 60 习题 第 6 章正则表达式 struct Request { // request method, POST, GET; path; HTTP version std::string method, path, http_version; // Request parse_request(std::istream& stream) const { // TODO } } 请实现成员函数 start() 与 parse_request。使得服务器模板使用者可以如下指定路由: templatevoid start_server(SERVER_TYPE &server) { // process 章正则表达式 [](ostream& response, Request& request) { string number=request.path_match[1]; response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length() << "\r\n\r\n" << number; }; // peocess default 0 码力 | 83 页 | 2.42 MB | 1 年前3C++高性能并行编程与优化 - 课件 - 06 TBB 开启的并行编程之旅
并行:多核处理器,每个处理器执行一个线 程,真正的同时运行。目的:将一个任务分 派到多个核上,从而更快完成任务。 举个例子 • 并发:某互联网公司购置了一台单核处理 器的服务器,他正同时处理 4 个 HTTP 请求,如果是单线程的 listen-accept 循环 ,则在处理完 A 的请求之前, B 的请求 就无法处理,造成“无响应”现象。 C 的请 求进来,则还得继续排队……0 码力 | 116 页 | 15.85 MB | 1 年前3C++高性能并行编程与优化 - 课件 - 15 C++ 系列课:字符与字符串
c == 127 )。 • toupper(c) 把小写字母转换为大写字母,如果不是则原封不动返回。 • tolower(c) 把大写字母转换为小写字母,如果不是则原封不动返回。 帮手函数大全 http://c.biancheng.net/ref/ctype_h/ 关于 char 类型的一个冷知识 • C 语言其实只规定了 unsigned char 是无符号 8 位整数, signed char 给的 i 超过了字符 串大小 i ≥ s.size() ,那程序的行为是未定义的,因为这个地方可能 有其他的对象,程序可能会奔溃,也可能行为异常。如果是富连网 程序,还可能会被黑客利用,窃取或篡改服务器上的数据。 • 那为什么还要 [] ?性能! at 做越界检测需要额外的开销, [] 不需 要。 • 所以 [] 更高效, at 更安全。遇到诡异 bug 时,试试把 [] 都改 成 at 。 编码中就是“烫”,所以如果不小心打印了栈上 未初始化的字符串数组,就会看到“烫烫烫”。 • 而 0xCDCD 在 GBK 编码中就是“屯”,所以如果不小心打印了堆上 未初始化的字符串数组,就会看到“屯屯屯”。 http://mytju.com/classcode/tools/encode_gb2312.asp 总结 • 现在普遍采用了 UTF-8 格式,虽然 Windows 还在用 UTF-16 和 GBK0 码力 | 162 页 | 40.20 MB | 1 年前3《深入浅出MFC》2/e
于繁简转译制作 上的费时费工,鉴于我对同胞的感情,我决定开放此书内容,供各位免费阅读。 我已为《深入浅出MFC 》2/e 制作了PDF 格式之电子文件, 放在 http://www.jjhou.com 供自由下载。北京http://expert.csdn.net/jjhou 有侯捷网站的 一个GBK mirror,各位也可试着自该处下载。 我所做的这份电子书是繁体版,我没有精力与时间将它转为简体。这已是我能 件,可以绑定(binding)近端和远程的资料源(data sources)。整合环境方面,Visual C++ 4.2 提供新的Wizard 给ActiveX 程序开发使用,改善了影像编辑器,使它能够处理在 Web 服务器上的两个标准图档格式:GIF 和JPEG。 1997 年五月推出的Visual C++ 5.0,主要诉求在编译器的速度改善,并将Visual C++ 合 并到微软整个Visual Tools 的终极管理软件Visual 务系统中(如 Win95 或WinNT),控制权被排程器强制移转,也因此两个执行线程之间的执行次序变得 不可预期。这不可预期性造成了所谓的race conditions。 假设你正在一个文件服务器中编辑一串电话号码。文件打开来内容如下: Charley 572-7993 Graffie 573-3976 Dennis 571-4219 第㆕篇 深入 MFC 程式設計 764 Good0 码力 | 1009 页 | 11.08 MB | 1 年前3From Eager Futures/Promises to Lazy Continuations: Evolving an Actor Library Based on Lessons Learned from Large-Scale Deployments
"))motivating example std::string SpellCheck(std::string text) { auto body = http::UrlEncode({"text", text}); auto response = http::Post("https://www.online-spellcheck.com", body); return response.body; }motivating example std::string SpellCheck(std::string text) { auto body = http::UrlEncode({"text", text}); auto response = http::Post("https://www.online-spellcheck.com", body); return response.body; }motivating example std::string SpellCheck(std::string text) { auto body = http::UrlEncode({"text", text}); auto response = http::Post("https://www.online-spellcheck.com", body); return response.body;0 码力 | 264 页 | 588.96 KB | 5 月前3Conan 1.16 Documentation
the 1.9.0 version: $ conan inspect Poco/1.9.0@pocoproject/stable ... name: Poco version: 1.9.0 url: http://github.com/pocoproject/conan-poco license: The Boost Software License 1.0 author: None description: 606fdb601e335c2001bdf31d478826b644747077 BuildID: None Remote: conan-center=https://conan.bintray.com URL: http://github.com/conan-community/conan-openssl License: The current OpenSSL licence is an 'Apache style' 09378ed7f51185386e9f04b212b79fe2d12d005c BuildID: None Remote: conan-center=https://conan.bintray.com URL: http://github.com/pocoproject/conan-poco License: The Boost Software License 1.0 Recipe: Cache Binary:0 码力 | 545 页 | 4.34 MB | 1 年前3Conan 1.8 Documentation
the 1.9.0 version: $ conan inspect Poco/1.9.0@pocoproject/stable ... name: Poco version: 1.9.0 url: http://github.com/pocoproject/conan-poco license: The Boost Software License 1.0 author: None description: 606fdb601e335c2001bdf31d478826b644747077 BuildID: None Remote: conan-center=https://conan.bintray.com URL: http://github.com/conan-community/conan-openssl License: The current OpenSSL licence is an 'Apache style' 09378ed7f51185386e9f04b212b79fe2d12d005c BuildID: None Remote: conan-center=https://conan.bintray.com URL: http://github.com/pocoproject/conan-poco License: The Boost Software License 1.0 Recipe: Cache Binary:0 码力 | 458 页 | 3.03 MB | 1 年前3Conan 1.9 Documentation
the 1.9.0 version: $ conan inspect Poco/1.9.0@pocoproject/stable ... name: Poco version: 1.9.0 url: http://github.com/pocoproject/conan-poco license: The Boost Software License 1.0 author: None description: 606fdb601e335c2001bdf31d478826b644747077 BuildID: None Remote: conan-center=https://conan.bintray.com URL: http://github.com/conan-community/conan-openssl License: The current OpenSSL licence is an 'Apache style' 09378ed7f51185386e9f04b212b79fe2d12d005c BuildID: None Remote: conan-center=https://conan.bintray.com URL: http://github.com/pocoproject/conan-poco License: The Boost Software License 1.0 Recipe: Cache Binary:0 码力 | 470 页 | 3.05 MB | 1 年前3Conan 1.11 Documentation
the 1.9.0 version: $ conan inspect Poco/1.9.0@pocoproject/stable ... name: Poco version: 1.9.0 url: http://github.com/pocoproject/conan-poco license: The Boost Software License 1.0 author: None description: 606fdb601e335c2001bdf31d478826b644747077 BuildID: None Remote: conan-center=https://conan.bintray.com URL: http://github.com/conan-community/conan-openssl License: The current OpenSSL licence is an 'Apache style' 09378ed7f51185386e9f04b212b79fe2d12d005c BuildID: None Remote: conan-center=https://conan.bintray.com URL: http://github.com/pocoproject/conan-poco License: The Boost Software License 1.0 Recipe: Cache Binary:0 码力 | 490 页 | 4.05 MB | 1 年前3
共 141 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15