Creating a Sender/Receiver HTTP ServerTechAtBloomberg.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 | 6 月前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 年前3
C++高性能并行编程与优化 - 课件 - 06 TBB 开启的并行编程之旅并行:多核处理器,每个处理器执行一个线 程,真正的同时运行。目的:将一个任务分 派到多个核上,从而更快完成任务。 举个例子 • 并发:某互联网公司购置了一台单核处理 器的服务器,他正同时处理 4 个 HTTP 请求,如果是单线程的 listen-accept 循环 ,则在处理完 A 的请求之前, B 的请求 就无法处理,造成“无响应”现象。 C 的请 求进来,则还得继续排队……0 码力 | 116 页 | 15.85 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 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
Conan 1.8 Documentationpackages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application. Both the Conan client and the conan_server are OSS 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: Remote: conan-center=https://conan.bintray.com URL: http://github.com/conan-community/conan-openssl License: The current OpenSSL licence is an 'Apache style' license: https://www. ˓→openssl.org/source/license0 码力 | 458 页 | 3.03 MB | 1 年前3
Conan 1.9 Documentationpackages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application. Both the Conan client and the conan_server are OSS 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: Remote: conan-center=https://conan.bintray.com URL: http://github.com/conan-community/conan-openssl License: The current OpenSSL licence is an 'Apache style' license: https://www. ˓→openssl.org/source/license0 码力 | 470 页 | 3.05 MB | 1 年前3
Conan 1.3 Documentationpackages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application. Both the conan client and the conan_server are OSS remote easily. For a remote running in your machine, you could run: $ conan remote add my_local_server http://localhost:9300 You can search any remote in the same way you search your computer. Actually, many first (newer Java versions preferred). Once Artifactory has started, navigate to the default URL http://localhost:8081, where the Web UI should be running. The default user and password are admin:password0 码力 | 397 页 | 2.77 MB | 1 年前3
Conan 1.11 Documentationpackages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application. Both the Conan client and the conan_server are OSS 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: Remote: conan-center=https://conan.bintray.com URL: http://github.com/conan-community/conan-openssl License: The current OpenSSL licence is an 'Apache style' license: https://www. ˓→openssl.org/source/license0 码力 | 490 页 | 4.05 MB | 1 年前3
Conan 1.10 Documentationpackages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application. Both the Conan client and the conan_server are OSS 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: Remote: conan-center=https://conan.bintray.com URL: http://github.com/conan-community/conan-openssl License: The current OpenSSL licence is an 'Apache style' license: https://www. ˓→openssl.org/source/license0 码力 | 479 页 | 3.09 MB | 1 年前3
Conan 1.6 Documentationpackages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application. Both the Conan client and the conan_server are OSS remote easily. For a remote running in your machine, you could run: $ conan remote add my_local_server http://localhost:9300 You can search any remote in the same way you search your computer. Actually, many first (newer Java versions preferred). Once Artifactory has started, navigate to the default URL http://localhost:8081, where the Web UI should be running. The default user and password are admin:password0 码力 | 428 页 | 2.87 MB | 1 年前3
共 148 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15













